throw new RuntimeException("Error. Local file not found"); StandardFileSystemManager manager = new StandardFileSystemManager(); StandardFileSystemManager manager = new StandardFileSystemManager(); StandardFileSystemManager manager = new StandardFileSystemManager(); StandardFileSystemManager manager = new StandardFileSystemManager(); StandardFileSystemManager manager = new StandardFileSystemManager();
StandardFileSystemManager manager = new StandardFileSystemManager();
StandardFileSystemManager manager = new StandardFileSystemManager();
StandardFileSystemManager manager = new StandardFileSystemManager();
/** * Get a new instance of FileSystemManager. * @return an instance of FileSystemManager */ static public FileSystemManager getManager(){ StandardFileSystemManager fsManager = new StandardFileSystemManager(); try { fsManager.init(); } catch (FileSystemException e) { log.error("Cannot initialize StandardFileSystemManager.", e); } return fsManager; }
StandardFileSystemManager fsManager = new StandardFileSystemManager(); fsManager.init();
public static StandardFileSystemManager getManager() { StandardFileSystemManager fsm = null; try { fsm = new StandardFileSystemManager(); fsm.init(); } catch (FileSystemException e) { log.error("Unable to get FileSystemManager: " + e.getMessage(), e); } return fsm; }
/** * Returns the global filesystem manager * * @return the global filesystem manager */ public static FileSystemManager getFileSystemManager() { aLock.readLock().lock(); try { if (fileSystemManager == null) { try { StandardFileSystemManager fm = new StandardFileSystemManager(); fm.setCacheStrategy(CacheStrategy.MANUAL); fm.init(); LOGGER.info("Supported schemes: {} ", Joiner.on(", ").join(fm.getSchemes())); fileSystemManager = fm; } catch (Exception exc) { throw new RuntimeException(exc); } } return fileSystemManager; } finally { aLock.readLock().unlock(); } }
StandardFileSystemManager manager = new StandardFileSystemManager(); FileObject target = manager.resolveFile("file://" + path + File.separator + filenameTarget); FileObject source = manager.resolveFile(sftpUri + path + File.separator + filenameSource, options); target.copyFrom(fichierSource, Selectors.SELECT_SELF);
@Override protected void doInit() throws AxisFault { super.doInit(); try { StandardFileSystemManager fsm = new StandardFileSystemManager(); fsm.setConfiguration(getClass().getClassLoader().getResource("providers.xml")); fsm.init(); this.workerPool = super.workerPool; fsManager = fsm; Parameter lockFlagParam = getTransportInDescription().getParameter(VFSConstants.TRANSPORT_FILE_LOCKING); if (lockFlagParam != null) { String strLockingFlag = lockFlagParam.getValue().toString(); // by-default enabled, if explicitly specified as "disable" make it disable if (VFSConstants.TRANSPORT_FILE_LOCKING_DISABLED.equals(strLockingFlag)) { globalFileLockingFlag = false; } } } catch (FileSystemException e) { handleException("Error initializing the file transport : " + e.getMessage(), e); } }
/** * Creates a {@link FileSystemManager} instance. * @return a {@link FileSystemManager} instance. * @throws FileSystemException if an error occurs creating the manager. */ protected FileSystemManager createFileSystemManager() throws FileSystemException { FileSystemManager fileSystemManager = null; try { if (getFileSystemManagerClassName() == null) { fileSystemManager = new StandardFileSystemManager(); } else { final Class<?> mgrClass = Class.forName(getFileSystemManagerClassName()); fileSystemManager = (FileSystemManager) mgrClass.newInstance(); } if (fileSystemManager instanceof DefaultFileSystemManager) { ((DefaultFileSystemManager) fileSystemManager).init(); } } catch (final Exception e) { throw new FileSystemException( "Could not create file system manager of class: " + getFileSystemManagerClassName(), e); } return fileSystemManager; }
@Before public void setUp() throws Exception { // get a full blown, fully functional manager fsm = new StandardFileSystemManager(); fsm.init(); }
@Before public void setUp() throws Exception { // get a full blown, fully functional manager fsm = new StandardFileSystemManager(); fsm.init(); }
@Before public void setUp() throws Exception { // get a full blown, fully functional manager fsm = new StandardFileSystemManager(); fsm.init(); }
/** * Creates a {@link FileSystemManager} instance. * @return a {@link FileSystemManager} instance. * @throws RepositoryException if an error occurs creating the manager. */ protected FileSystemManager createFileSystemManager() throws RepositoryException { FileSystemManager fileSystemManager = null; try { if (getFileSystemManagerClassName() == null) { fileSystemManager = new StandardFileSystemManager(); } else { final Class<?> mgrClass = Class.forName(getFileSystemManagerClassName()); fileSystemManager = (FileSystemManager) mgrClass.newInstance(); } if (fileSystemManager instanceof DefaultFileSystemManager) { ((DefaultFileSystemManager) fileSystemManager).init(); } } catch (final FileSystemException e) { throw new RepositoryException( "Could not initialize file system manager of class: " + getFileSystemManagerClassName(), e); } catch (final Exception e) { throw new RepositoryException( "Could not create file system manager of class: " + getFileSystemManagerClassName(), e); } return fileSystemManager; }
/** * Resolves a URI to a file, relative to the project's base directory. * * @param uri The URI to resolve. * @return resolved file object. * @throws FileSystemException If an error occurred. */ protected FileObject resolveFile(final String uri) throws FileSystemException { if (manager == null) { final StandardFileSystemManager mngr = new StandardFileSystemManager(); mngr.setLogger(new AntLogger()); mngr.init(); manager = mngr; getProject().addBuildListener(new CloseListener()); } return manager.resolveFile(getProject().getBaseDir(), uri); }
/** * Resolves a URI to a file, relative to the project's base directory. * * @param uri The URI to resolve. * @return resolved file object. * @throws FileSystemException If an error occurred. */ protected FileObject resolveFile(final String uri) throws FileSystemException { if (manager == null) { final StandardFileSystemManager mngr = new StandardFileSystemManager(); mngr.setLogger(new AntLogger()); mngr.init(); manager = mngr; getProject().addBuildListener(new CloseListener()); } return manager.resolveFile(getProject().getBaseDir(), uri); }
/** * Resolves a URI to a file, relative to the project's base directory. * * @param uri The URI to resolve. * @return resolved file object. * @throws FileSystemException If an error occurred. */ protected FileObject resolveFile(final String uri) throws FileSystemException { if (manager == null) { final StandardFileSystemManager mngr = new StandardFileSystemManager(); mngr.setLogger(new AntLogger()); mngr.init(); manager = mngr; getProject().addBuildListener(new CloseListener()); } return manager.resolveFile(getProject().getBaseDir(), uri); }
@Test public void test_setManager() throws FileSystemException { final StandardFileSystemManager fileSystemManager = new StandardFileSystemManager(); VFS.setManager(fileSystemManager); Assert.assertEquals(fileSystemManager, VFS.getManager()); // Reset global for other tests VFS.setManager(null); Assert.assertNotNull(VFS.getManager()); Assert.assertNotEquals(fileSystemManager, VFS.getManager()); } }
@Test public void test_setManager() throws FileSystemException { final StandardFileSystemManager fileSystemManager = new StandardFileSystemManager(); VFS.setManager(fileSystemManager); Assert.assertEquals(fileSystemManager, VFS.getManager()); // Reset global for other tests VFS.setManager(null); Assert.assertNotNull(VFS.getManager()); Assert.assertNotEquals(fileSystemManager, VFS.getManager()); } }