FileSystemUtils { static void writeEntryToStream(FolderEntry folderEntry, OutputStream outputStream) throws IOException { Properties properties = new Properties(); properties.setProperty(CONTENT_TYPE, folderEntry.getContentType().toString()); properties.setProperty(CONTENT_ID, folderEntry.getContentId()); properties.setProperty(FOLDER_ID, folderEntry.getFolderId()); properties.store(outputStream, "saved"); } private  FileSystemUtils(); static String toId(FolderPath folderPath); static FolderPath fromId(String id);  }
@Test public void writeEntryToStream() throws Exception { ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); FolderEntry folderEntry = new FolderEntry(); folderEntry.setContentType(FolderContentType.PREPARATION); folderEntry.setContentId("contentId"); folderEntry.setFolderId("folderId"); FileSystemUtils.writeEntryToStream(folderEntry, outputStream); outputStream.close(); Properties properties = new Properties(); properties.load(new ByteArrayInputStream(outputStream.toByteArray())); assertEquals("contentId", properties.getProperty("contentId")); assertEquals("folderId", properties.getProperty("folderId")); assertEquals(FolderContentType.PREPARATION, FolderContentType.fromName(properties.getProperty("contentType"))); }