FileSystemUtils { static FolderEntry toFolderEntry(Path pathFile) { FolderEntry folderEntry; try (InputStream inputStream = Files.newInputStream(pathFile)) { Properties properties = new Properties(); properties.load(inputStream); folderEntry = new FolderEntry(); folderEntry.setFolderId(properties.getProperty(FOLDER_ID)); folderEntry.setContentType(FolderContentType.fromName(properties.getProperty(CONTENT_TYPE))); folderEntry.setContentId(properties.getProperty(CONTENT_ID)); } catch (IOException e) { throw new TDPException(UNABLE_TO_READ_FOLDER_ENTRY, e, build().put("path", pathFile)); } return folderEntry; } private  FileSystemUtils(); static String toId(FolderPath folderPath); static FolderPath fromId(String id);  }
@Test public void toFolderEntry() throws Exception { Path testEntry = testFolder.resolve("testEntry"); String contentId = "contentId"; String folderId = "folderId"; FolderContentType contentType = FolderContentType.PREPARATION; createEntry(testEntry, contentId, folderId, contentType); FolderEntry folderEntry = FileSystemUtils.toFolderEntry(testEntry); assertNotNull(folderEntry); assertEquals(contentId, folderEntry.getContentId()); assertEquals(folderId, folderEntry.getFolderId()); assertEquals(contentType, folderEntry.getContentType()); }