/** * Sets the configuration file for this manager. * * @param configUri The URI for this manager. */ public void setConfiguration(final String configUri) { try { setConfiguration(new URL(configUri)); } catch (final MalformedURLException e) { getLogger().warn(e.getLocalizedMessage(), e); } }
/** * Sets the configuration file for this manager. * * @param configUri The URI for this manager. */ public void setConfiguration(final String configUri) { try { setConfiguration(new URL(configUri)); } catch (final MalformedURLException e) { getLogger().warn(e.getLocalizedMessage(), e); } }
/** * Sets the configuration file for this manager. * * @param configUri The URI for this manager. */ public void setConfiguration(final String configUri) { try { setConfiguration(new URL(configUri)); } catch (final MalformedURLException e) { getLogger().warn(e.getLocalizedMessage(), e); } }
/** * Sets the configuration file for this manager. * * @param configUri The URI for this manager. */ public void setConfiguration(final String configUri) { try { setConfiguration(new URL(configUri)); } catch (final MalformedURLException e) { getLogger().warn(e.getLocalizedMessage(), e); } }
private Shell() throws IOException { final String providers = System.getProperty("providers"); final URL providersUrl = (providers != null) ? Shell.class.getResource("/" + providers) : null; if (providersUrl != null) { mgr = new StandardFileSystemManager(); System.out.println("Custom providers configuration used: " + providersUrl); ((StandardFileSystemManager) mgr).setConfiguration(providersUrl); ((StandardFileSystemManager) mgr).init(); } else { mgr = VFS.getManager(); } // TODO: VFS-360 - Remove this manual registration of http4 once http4 becomes part of standard providers. boolean httpClient4Available = false; try { Class.forName("org.apache.http.client.HttpClient"); httpClient4Available = true; final DefaultFileSystemManager manager = (DefaultFileSystemManager) VFS.getManager(); if (!manager.hasProvider("http4")) { manager.addProvider("http4", (FileProvider) Class.forName("org.apache.commons.vfs2.provider.http4.Http4FileProvider").newInstance()); manager.addProvider("http4s", (FileProvider) Class.forName("org.apache.commons.vfs2.provider.http4s.Http4sFileProvider").newInstance()); } } catch (final Exception e) { if (httpClient4Available) { e.printStackTrace(); } } cwd = mgr.toFileObject(new File(System.getProperty("user.dir"))); reader = new BufferedReader(new InputStreamReader(System.in, Charset.defaultCharset())); }
@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); } }
try { StandardFileSystemManager fsm = new StandardFileSystemManager(); fsm.setConfiguration(getClass().getClassLoader().getResource("providers.xml")); fsm.init(); fsManager = fsm;