/******************************************************************************************************************* * * {@inheritDoc} * ******************************************************************************************************************/ @Override @Nonnull public synchronized FileSystem getFileSystem() throws IOException { if (fileSystem == null) { try { fileSystem = new LocalFileSystem(); fileSystem.setRootDirectory(new File(rootPath)); final FileObject rootFolder = fileSystem.getRoot(); if (rootFolder == null) { throw new FileNotFoundException(rootPath); } } catch (PropertyVetoException e) { throw new FileNotFoundException(e.toString()); } } return fileSystem; } }
/******************************************************************************************************************* * * {@inheritDoc} * ******************************************************************************************************************/ @Override @Nonnull public synchronized ResourceFileSystem getFileSystem() throws IOException { if (fileSystem == null) { try { fileSystemDelegate = new LocalFileSystem(); fileSystemDelegate.setRootDirectory(new File(rootPath)); final FileObject rootFolder = fileSystemDelegate.getRoot(); if (rootFolder == null) { throw new FileNotFoundException(rootPath); } fileSystem = new ResourceFileSystemNetBeansPlatform(fileSystemDelegate); } catch (PropertyVetoException e) { throw new FileNotFoundException(e.toString()); } } return fileSystem; } }
public void open(final URL[] urls) { try { if (urls.length >= 1) { final URL url = urls[0]; final GCDocument gcDocument = new GCDocument(this, url.toString()); gcDocument.add(url); gcDocument.addInternalFrameListener(gcDocumentListener); desktopPane.add(gcDocument); gcDocument.setSelected(true); gcDocument.setSize(450, 300); gcDocument.setMaximum(true); //addAction.setSelectedFile(url); gcDocument.setVisible(true); } if (urls.length>1) { final URL[] addURLs = new URL[urls.length-1]; System.arraycopy(urls, 1, addURLs, 0, addURLs.length); add(addURLs); } recentURLsMenu.getRecentURLsModel().add(urls); repaint(); } catch (DataReaderException e) { e.printStackTrace(); } catch (PropertyVetoException e) { e.printStackTrace(); JOptionPane.showMessageDialog(GCViewerGui.this, e.toString() + " " + e.getLocalizedMessage(), localStrings.getString("fileopen_dialog_read_file_failed"), JOptionPane.ERROR_MESSAGE); } }