/******************************************************************************************************************* * * {@inheritDoc} * ******************************************************************************************************************/ @Override @Nonnull public synchronized FileSystem getFileSystem() throws IOException { if (fileSystem == null) { fileSystem = new JarFileSystem(new File(zipFilePath)); final FileObject rootFolder = fileSystem.getRoot(); if (rootFolder == null) { throw new FileNotFoundException(zipFilePath); } } return fileSystem; } }
/******************************************************************************************************************* * * {@inheritDoc} * ******************************************************************************************************************/ @Override @Nonnull public synchronized ResourceFileSystem getFileSystem() throws IOException { if (fileSystem == null) { final File zipFile = new File(zipFilePath); fileSystemDelegate = new JarFileSystem(zipFile); final FileObject rootFolder = fileSystemDelegate.getRoot(); if (rootFolder == null) { throw new FileNotFoundException(zipFilePath); } log.info(">>>> fileSystem: {}", fileSystemDelegate); latestModified = new DateTime(zipFile.lastModified()); timer.scheduleAtFixedRate(zipFileModificationTracker, modificationCheckInterval, modificationCheckInterval); fileSystem = new ResourceFileSystemNetBeansPlatform(fileSystemDelegate); } return fileSystem; } }
private static Version getVersion(File systemJarFile) { if (!systemJarFile.exists()) { return null; } try { JarFileSystem systemJar = new JarFileSystem(); systemJar.setJarFile(systemJarFile); Attributes attributes = systemJar.getManifest().getMainAttributes(); String version = attributes.getValue("Specification-Version"); // NOI18N if (version != null) { return new Version(version); } return null; } catch (IOException ex) { LOGGER.log(Level.INFO, null, ex); return null; } catch (PropertyVetoException ex) { LOGGER.log(Level.INFO, null, ex); return null; } }
mainModuleID.setContextURL(getWebUrl(server_url, JbossWeb.createGraph(file2).getContextRoot())); } else if (file.getName().endsWith(".ear")) { JarFileSystem jfs = new JarFileSystem(); jfs.setJarFile(file); FileObject appXml = jfs.getRoot().getFileObject("META-INF/application.xml");