Bug 166972 [Workbench] Migrate org.eclipse.ui.ide.workbench to IApplication
bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/IDEApplication.java
* @param create
     *            If the directory and file does not exist this parameter
     *            controls whether it will be created.
     * @return An url to the file or null if the version file does not exist or
     *         could not be created.
     */
    private static File getVersionFile(URL workspaceUrl, boolean create) {
        if (workspaceUrl == null) {
			return null;
		}
        try {
            
            File metaDir = new File(workspaceUrl.getPath(), METADATA_FOLDER);
            if (!metaDir.exists() && (!create || !metaDir.mkdir())) {
				return null;
			}
            
            File versionFile = new File(metaDir, VERSION_FILENAME);
            if (!versionFile.exists()
                    && (!create || !versionFile.createNewFile())) {
				return null;
			}
            return versionFile;
        } catch (IOException e) {
            
            return null;
        }
    }
}