DocSetSupport { public static void createPList(String bundleIdentifier, String displayName, String keyword, String indexFile, String docsetDir) throws BuilderException { final String plist = String.format("<?xml version=\"1.0\" encoding=\"UTF-8\"?><plist version=\"1.0\"><dict><key>CFBundleIdentifier</key><string>%s</string><key>CFBundleName</key><string>%s</string><key>DocSetPlatformFamily</key><string>%s</string><key>dashIndexFilePath</key><string>%s</string><key>DashDocSetFamily</key><string>java</string><key>isDashDocset</key><true/></dict></plist>", bundleIdentifier, displayName, keyword, indexFile); try { write(getFile(getDocsetRoot(docsetDir), CONTENTS, PLIST_FILE), plist); logVerbose("Created the plist file in the docset"); } catch (IOException e) { throw new BuilderException("Failed to write plist file into docset", e); } } private  DocSetSupport(); static void createDocSetStructure(String docsetDir); static void copyIconFile(File iconFile, String docsetDir); static void copyFiles(final String sourceDir, String docsetDir); static void copyFiles(final File sourceDir, String docsetDir); static void createPList(String bundleIdentifier, String displayName, String keyword, String indexFile, String docsetDir); static String getDBDir(String docsetDir);  }
@Test public void testCreatePlist() throws Exception { final String docsetDir = createAndVerifyDocsetStructure("TestDoc"); createPList("Identifier", "displayName", "keyword", "indexFile", docsetDir); final File plist = getFile(getDocsetRoot(docsetDir), CONTENTS, "Info.plist"); assertNotNull(plist); assertTrue(plist.exists()); final NSDictionary rootDict = (NSDictionary) PropertyListParser.parse(plist); verifyPlistEntry(rootDict, "CFBundleIdentifier", "Identifier"); verifyPlistEntry(rootDict, "CFBundleName", "displayName"); verifyPlistEntry(rootDict, "DocSetPlatformFamily", "keyword"); verifyPlistEntry(rootDict, "dashIndexFilePath", "indexFile"); verifyPlistEntry(rootDict, "DashDocSetFamily", "java"); verifyPlistEntry(rootDict, "isDashDocset", "true"); }