/** * @return the uri of the under storage location of the entity referenced by this uri, mutable */ public String getUfsPath() { return mInfo.getUfsPath(); }
/** * Returns the ufs fingerprint of the given file, or null if the file doesn't exist. * * @param fileId the file id * @return the ufs fingerprint of the file if it exists, null otherwise */ private synchronized String ufsFingerprint(long fileId) throws IOException { FileInfo fileInfo = mBlockWorker.getFileInfo(fileId); String dstPath = fileInfo.getUfsPath(); try (CloseableResource<UnderFileSystem> ufsResource = mUfsManager.get(fileInfo.getMountId()).acquireUfsResource()) { UnderFileSystem ufs = ufsResource.get(); return ufs.isFile(dstPath) ? ufs.getFingerprint(dstPath) : null; } }
.setUfsPath(fileInfo.getUfsPath()).setLength(fileInfo.getLength()) .setBlockSizeBytes(fileInfo.getBlockSizeBytes()) .setCreationTimeMs(fileInfo.getCreationTimeMs()).setCompleted(fileInfo.isCompleted())
/** * Tests the {@link MutableInodeDirectory#generateClientFileInfo(String)} method. */ @Test public void generateClientFileInfo() { MutableInodeDirectory inodeDirectory = createInodeDirectory(); String path = "/test/path"; FileInfo info = inodeDirectory.generateClientFileInfo(path); Assert.assertEquals(inodeDirectory.getId(), info.getFileId()); Assert.assertEquals(inodeDirectory.getName(), info.getName()); Assert.assertEquals(path, info.getPath()); Assert.assertEquals("", info.getUfsPath()); Assert.assertEquals(0, info.getLength()); Assert.assertEquals(0, info.getBlockSizeBytes()); Assert.assertEquals(inodeDirectory.getCreationTimeMs(), info.getCreationTimeMs()); Assert.assertTrue(info.isCompleted()); Assert.assertTrue(info.isFolder()); Assert.assertEquals(inodeDirectory.isPinned(), info.isPinned()); Assert.assertFalse(info.isCacheable()); Assert.assertNotNull(info.getBlockIds()); Assert.assertEquals(inodeDirectory.getLastModificationTimeMs(), info.getLastModificationTimeMs()); } }
/** * @return the uri of the under storage location of the entity referenced by this uri, mutable */ public String getUfsPath() { return mInfo.getUfsPath(); }
/** * @return the uri of the under storage location of the entity referenced by this uri, mutable */ public String getUfsPath() { return mInfo.getUfsPath(); }
Assert.assertEquals(a.getTtlAction(), b.getTtlAction()); Assert.assertEquals(a.getMountId(), b.getMountId()); Assert.assertEquals(a.getUfsPath(), b.getUfsPath()); Assert.assertEquals(a.isCacheable(), b.isCacheable()); Assert.assertEquals(a.isCompleted(), b.isCompleted());
Assert.assertEquals(uriStatus.getTtl(), fileInfo.getTtl()); Assert.assertEquals(uriStatus.getTtlAction(), fileInfo.getTtlAction()); Assert.assertEquals(uriStatus.getUfsPath(), fileInfo.getUfsPath()); Assert.assertEquals(uriStatus.getOwner(), fileInfo.getOwner()); Assert.assertEquals(uriStatus.isCacheable(), fileInfo.isCacheable());