public static Resource newResource (File file) throws MalformedURLException, IOException { file = file.getCanonicalFile(); URL url = Resource.toURL(file); URLConnection connection = url.openConnection(); FileResource fileResource = new FileResource(url, connection, file); return fileResource; }
public static Resource newResource (File file) throws MalformedURLException, IOException { file = file.getCanonicalFile(); URL url = Resource.toURL(file); URLConnection connection = url.openConnection(); FileResource fileResource = new FileResource(url, connection, file); return fileResource; }
public static Resource newResource (File file) throws MalformedURLException, IOException { file = file.getCanonicalFile(); URL url = Resource.toURL(file); URLConnection connection = url.openConnection(); FileResource fileResource = new FileResource(url, connection, file); return fileResource; }
public static Resource newResource (File file) throws MalformedURLException, IOException { file = file.getCanonicalFile(); URL url = Resource.toURL(file); URLConnection connection = url.openConnection(); FileResource fileResource = new FileResource(url, connection, file); return fileResource; }
public static Resource newResource (File file) throws MalformedURLException, IOException { file = file.getCanonicalFile(); URL url = Resource.toURL(file); URLConnection connection = url.openConnection(); FileResource fileResource = new FileResource(url, connection, file); return fileResource; }
public static Resource newResource (File file) throws MalformedURLException, IOException { file = file.getCanonicalFile(); URL url = Resource.toURL(file); URLConnection connection = url.openConnection(); FileResource fileResource = new FileResource(url, connection, file); return fileResource; }
/** * @param file * @throws Exception * @deprecated use {@link #setContextsDir(String)} */ @Deprecated public void setConfigurationDir(File file) throws Exception { setConfigurationDir(Resource.newResource(Resource.toURL(file))); }
/** * Parse File. */ public synchronized Node parse(File file) throws IOException, SAXException { if (LOG.isDebugEnabled()) LOG.debug("parse: " + file); return parse(new InputSource(Resource.toURL(file).toString())); }
/** * Parse File. */ public synchronized Node parse(File file) throws IOException, SAXException { if (LOG.isDebugEnabled()) LOG.debug("parse: " + file); return parse(new InputSource(Resource.toURL(file).toString())); }
/** * Parse File. */ public synchronized Node parse(File file) throws IOException, SAXException { if (LOG.isDebugEnabled()) LOG.debug("parse: " + file); return parse(new InputSource(Resource.toURL(file).toString())); }
/** * Parse File. */ public synchronized Node parse(File file) throws IOException, SAXException { if (LOG.isDebugEnabled()) LOG.debug("parse: " + file); return parse(new InputSource(Resource.toURL(file).toString())); }
/** * Parse File. */ public synchronized Node parse(File file) throws IOException, SAXException { if (LOG.isDebugEnabled()) LOG.debug("parse: " + file); return parse(new InputSource(Resource.toURL(file).toString())); }
/** * Parse File. * @param file the file to the xml to parse * @return the root node of the xml * @throws IOException if unable to load the xml * @throws SAXException if unable to parse the xml */ public synchronized Node parse(File file) throws IOException, SAXException { if (LOG.isDebugEnabled()) LOG.debug("parse: " + file); return parse(new InputSource(Resource.toURL(file).toString())); }
public void applyJettyXml() throws Exception { if (jettyXmls == null) return; for ( File xmlFile : jettyXmls ) { LOG.info( "Configuring Jetty from xml configuration file = " + xmlFile.getCanonicalPath() ); XmlConfiguration xmlConfiguration = new XmlConfiguration(Resource.toURL(xmlFile)); xmlConfiguration.configure(this.server); } }
public void applyJettyXml() throws Exception { if (getJettyXmlFiles() == null) return; for ( File xmlFile : getJettyXmlFiles() ) { getLog().info( "Configuring Jetty from xml configuration file = " + xmlFile.getCanonicalPath() ); XmlConfiguration xmlConfiguration = new XmlConfiguration(Resource.toURL(xmlFile)); xmlConfiguration.configure(this.server); } }
@Override public URL getAlias() { if (__checkAliases && !_aliasChecked) { try { String abs=_file.getAbsolutePath(); String can=_file.getCanonicalPath(); if (abs.length()!=can.length() || !abs.equals(can)) _alias=Resource.toURL(new File(can)); _aliasChecked=true; if (_alias!=null && LOG.isDebugEnabled()) { LOG.debug("ALIAS abs="+abs); LOG.debug("ALIAS can="+can); } } catch(Exception e) { LOG.warn(Log.EXCEPTION,e); return getURL(); } } return _alias; }
@Override public URL getAlias() { if (!_aliasChecked) { try { String abs=_file.getAbsolutePath(); String can=_file.getCanonicalPath(); if (abs.length()!=can.length() || !abs.equals(can)) _alias=Resource.toURL(new File(can)); _aliasChecked=true; if (_alias!=null && LOG.isDebugEnabled()) { LOG.debug("ALIAS abs="+abs); LOG.debug("ALIAS can="+can); } } catch(Exception e) { LOG.warn(Log.EXCEPTION,e); return getURL(); } } return _alias; }
@Override public URL getAlias() { if (__checkAliases && !_aliasChecked) { try { String abs=_file.getAbsolutePath(); String can=_file.getCanonicalPath(); if (abs.length()!=can.length() || !abs.equals(can)) _alias=Resource.toURL(new File(can)); _aliasChecked=true; if (_alias!=null && LOG.isDebugEnabled()) { LOG.debug("ALIAS abs="+abs); LOG.debug("ALIAS can="+can); } } catch(Exception e) { LOG.warn(Log.EXCEPTION,e); return getURL(); } } return _alias; }
@Override public URL getAlias() { if (__checkAliases && !_aliasChecked) { try { String abs=_file.getAbsolutePath(); String can=_file.getCanonicalPath(); if (abs.length()!=can.length() || !abs.equals(can)) _alias=Resource.toURL(new File(can)); _aliasChecked=true; if (_alias!=null && LOG.isDebugEnabled()) { LOG.debug("ALIAS abs="+abs); LOG.debug("ALIAS can="+can); } } catch(Exception e) { LOG.warn(Log.EXCEPTION,e); return getURL(); } } return _alias; }
@Override public URL getAlias() { if (__checkAliases && !_aliasChecked) { try { String abs=_file.getAbsolutePath(); String can=_file.getCanonicalPath(); if (abs.length()!=can.length() || !abs.equals(can)) _alias=Resource.toURL(new File(can)); _aliasChecked=true; if (_alias!=null && LOG.isDebugEnabled()) { LOG.debug("ALIAS abs="+abs); LOG.debug("ALIAS can="+can); } } catch(Exception e) { LOG.warn(Log.EXCEPTION,e); return getURL(); } } return _alias; }