private File getWebApiDocsDir() { // load the rest documentation final File webApiDocsDir = new File(webApiContext.getTempDirectory(), "webapp/docs"); if (!webApiDocsDir.exists()) { final boolean made = webApiDocsDir.mkdirs(); if (!made) { logger.error("Failed to create " + webApiDocsDir.getAbsolutePath()); startUpFailure(new IOException(webApiDocsDir.getAbsolutePath() + " could not be created")); } } return webApiDocsDir; }
/** * @see org.eclipse.jetty.webapp.AbstractConfiguration#cloneConfigure(org.eclipse.jetty.webapp.WebAppContext, org.eclipse.jetty.webapp.WebAppContext) */ @Override public void cloneConfigure(WebAppContext template, WebAppContext context) throws Exception { File tmpDir=File.createTempFile(WebInfConfiguration.getCanonicalNameForWebAppTmpDir(context),"",template.getTempDirectory().getParentFile()); if (tmpDir.exists()) { IO.delete(tmpDir); } tmpDir.mkdir(); tmpDir.deleteOnExit(); context.setTempDirectory(tmpDir); }
@Override public void run() { final FileTime now = FileTime.fromMillis( System.currentTimeMillis() ); for ( final Handler handler : this.server.getChildHandlersByClass( WebAppContext.class ) ) { final File tempDirectory = ((WebAppContext) handler).getTempDirectory(); try { Log.debug( "Updating the last modified timestamp of content in Jetty's temporary storage in: {}", tempDirectory); Files.walk( tempDirectory.toPath() ) .forEach( f -> { try { Log.trace( "Setting the last modified timestamp of file '{}' in Jetty's temporary storage to: {}", f, now); Files.setLastModifiedTime( f, now ); } catch ( IOException e ) { Log.warn( "An exception occurred while trying to update the last modified timestamp of content in Jetty's temporary storage in: {}", f, e ); } } ); } catch ( IOException e ) { Log.warn( "An exception occurred while trying to update the last modified timestamp of content in Jetty's temporary storage in: {}", tempDirectory, e ); } } } }
File tmpDir = context.getTempDirectory(); if (tmpDir != null)
extractedWebAppDir= new File(context.getTempDirectory(), "webapp"); File extractionLock = new File (context.getTempDirectory(), ".extract_lock"); File extractedWebInfDir= new File(context.getTempDirectory(), "webinf"); if (extractedWebInfDir.exists()) IO.delete(extractedWebInfDir);
@Override public void deconfigure(WebAppContext context) throws Exception { //if we're not persisting the temp dir contents delete it if (!context.isPersistTempDirectory()) { IO.delete(context.getTempDirectory()); } //if it wasn't explicitly configured by the user, then unset it Boolean tmpdirConfigured = (Boolean)context.getAttribute(TEMPDIR_CONFIGURED); if (tmpdirConfigured != null && !tmpdirConfigured) context.setTempDirectory(null); //reset the base resource back to what it was before we did any unpacking of resources if (context.getBaseResource() != null) context.getBaseResource().close(); context.setBaseResource(_preUnpackBaseResource); }
protected void createContextTempDirectory() { if (context.getTempDirectory() == null) { File tmpDir = new File(System.getProperty("java.io.tmpdir")); tmpDir.mkdirs(); context.setTempDirectory(tmpDir); } }
protected void createContextTempDirectory() { if (context.getTempDirectory() == null) { File tmpDir = new File(System.getProperty("java.io.tmpdir")); tmpDir.mkdirs(); context.setTempDirectory(tmpDir); } }
public void init () throws IOException { if (_path==null || "".equals(_path.trim())) _delegate = new DexClassLoader("", ((WebAppContext)getContext()).getTempDirectory().getCanonicalPath(),null,_parent); else _delegate = new DexClassLoader(_path, ((WebAppContext)getContext()).getTempDirectory().getCanonicalPath(), null, _parent); if (Log.isDebugEnabled()) Log.debug("Android webapp classloader path= "+_path+" tmpdir="+ ((WebAppContext)getContext()).getTempDirectory()+" dexloader = "+_delegate+" parentloader="+_parent); }
/** * @see org.eclipse.jetty.webapp.AbstractConfiguration#cloneConfigure(org.eclipse.jetty.webapp.WebAppContext, org.eclipse.jetty.webapp.WebAppContext) */ @Override public void cloneConfigure(WebAppContext template, WebAppContext context) throws Exception { File tmpDir=File.createTempFile(WebInfConfiguration.getCanonicalNameForWebAppTmpDir(context),"",template.getTempDirectory().getParentFile()); if (tmpDir.exists()) { IO.delete(tmpDir); } tmpDir.mkdir(); tmpDir.deleteOnExit(); context.setTempDirectory(tmpDir); }
/** * @see org.eclipse.jetty.webapp.AbstractConfiguration#cloneConfigure(org.eclipse.jetty.webapp.WebAppContext, org.eclipse.jetty.webapp.WebAppContext) */ @Override public void cloneConfigure(WebAppContext template, WebAppContext context) throws Exception { File tmpDir=File.createTempFile(WebInfConfiguration.getCanonicalNameForWebAppTmpDir(context),"",template.getTempDirectory().getParentFile()); if (tmpDir.exists()) { IO.delete(tmpDir); } tmpDir.mkdir(); tmpDir.deleteOnExit(); context.setTempDirectory(tmpDir); }
/** * @see org.eclipse.jetty.webapp.AbstractConfiguration#cloneConfigure(org.eclipse.jetty.webapp.WebAppContext, org.eclipse.jetty.webapp.WebAppContext) */ @Override public void cloneConfigure(WebAppContext template, WebAppContext context) throws Exception { File tmpDir=File.createTempFile(WebInfConfiguration.getCanonicalNameForWebAppTmpDir(context),"",template.getTempDirectory().getParentFile()); if (tmpDir.exists()) { IO.delete(tmpDir); } tmpDir.mkdir(); tmpDir.deleteOnExit(); context.setTempDirectory(tmpDir); }
/** * @see org.eclipse.jetty.webapp.AbstractConfiguration#cloneConfigure(org.eclipse.jetty.webapp.WebAppContext, org.eclipse.jetty.webapp.WebAppContext) */ @Override public void cloneConfigure(WebAppContext template, WebAppContext context) throws Exception { File tmpDir=File.createTempFile(WebInfConfiguration.getCanonicalNameForWebAppTmpDir(context),"",template.getTempDirectory().getParentFile()); if (tmpDir.exists()) { IO.delete(tmpDir); } tmpDir.mkdir(); tmpDir.deleteOnExit(); context.setTempDirectory(tmpDir); }
/** * @see org.eclipse.jetty.webapp.AbstractConfiguration#cloneConfigure(org.eclipse.jetty.webapp.WebAppContext, org.eclipse.jetty.webapp.WebAppContext) */ @Override public void cloneConfigure(WebAppContext template, WebAppContext context) throws Exception { File tmpDir=File.createTempFile(WebInfConfiguration.getCanonicalNameForWebAppTmpDir(context),"",template.getTempDirectory().getParentFile()); if (tmpDir.exists()) { IO.delete(tmpDir); } tmpDir.mkdir(); tmpDir.deleteOnExit(); context.setTempDirectory(tmpDir); }
/** * @see org.eclipse.jetty.webapp.AbstractConfiguration#cloneConfigure(org.eclipse.jetty.webapp.WebAppContext, org.eclipse.jetty.webapp.WebAppContext) */ @Override public void cloneConfigure(WebAppContext template, WebAppContext context) throws Exception { File tmpDir=File.createTempFile(WebInfConfiguration.getCanonicalNameForWebAppTmpDir(context),"",template.getTempDirectory().getParentFile()); if (tmpDir.exists()) { IO.delete(tmpDir); } tmpDir.mkdir(); tmpDir.deleteOnExit(); context.setTempDirectory(tmpDir); }
@Override public void deconfigure(WebAppContext context) throws Exception { // delete temp directory if we had to create it or if it isn't called work Boolean tmpdirConfigured = (Boolean)context.getAttribute(TEMPDIR_CONFIGURED); if (context.getTempDirectory()!=null && (tmpdirConfigured == null || !tmpdirConfigured.booleanValue()) && !isTempWorkDirectory(context.getTempDirectory())) { IO.delete(context.getTempDirectory()); context.setTempDirectory(null); //clear out the context attributes for the tmp dir only if we had to //create the tmp dir context.setAttribute(TEMPDIR_CONFIGURED, null); context.setAttribute(WebAppContext.TEMPDIR, null); } //reset the base resource back to what it was before we did any unpacking of resources context.setBaseResource(_preUnpackBaseResource); }
@Override public void deconfigure(WebAppContext context) throws Exception { // delete temp directory if we had to create it or if it isn't called work Boolean tmpdirConfigured = (Boolean)context.getAttribute(TEMPDIR_CONFIGURED); if (context.getTempDirectory()!=null && (tmpdirConfigured == null || !tmpdirConfigured.booleanValue()) && !isTempWorkDirectory(context.getTempDirectory())) { IO.delete(context.getTempDirectory()); context.setTempDirectory(null); //clear out the context attributes for the tmp dir only if we had to //create the tmp dir context.setAttribute(TEMPDIR_CONFIGURED, null); context.setAttribute(WebAppContext.TEMPDIR, null); } //reset the base resource back to what it was before we did any unpacking of resources context.setBaseResource(_preUnpackBaseResource); }
@Override public void deconfigure(WebAppContext context) throws Exception { // delete temp directory if we had to create it or if it isn't called work Boolean tmpdirConfigured = (Boolean)context.getAttribute(TEMPDIR_CONFIGURED); if (context.getTempDirectory()!=null && (tmpdirConfigured == null || !tmpdirConfigured.booleanValue()) && !isTempWorkDirectory(context.getTempDirectory())) { IO.delete(context.getTempDirectory()); context.setTempDirectory(null); //clear out the context attributes for the tmp dir only if we had to //create the tmp dir context.setAttribute(TEMPDIR_CONFIGURED, null); context.setAttribute(WebAppContext.TEMPDIR, null); } //reset the base resource back to what it was before we did any unpacking of resources context.setBaseResource(_preUnpackBaseResource); }
@Override public void deconfigure(WebAppContext context) throws Exception { // delete temp directory if we had to create it or if it isn't called work Boolean tmpdirConfigured = (Boolean)context.getAttribute(TEMPDIR_CONFIGURED); if (context.getTempDirectory()!=null && (tmpdirConfigured == null || !tmpdirConfigured.booleanValue()) && !isTempWorkDirectory(context.getTempDirectory())) { IO.delete(context.getTempDirectory()); context.setTempDirectory(null); //clear out the context attributes for the tmp dir only if we had to //create the tmp dir context.setAttribute(TEMPDIR_CONFIGURED, null); context.setAttribute(WebAppContext.TEMPDIR, null); } //reset the base resource back to what it was before we did any unpacking of resources context.setBaseResource(_preUnpackBaseResource); }
@Override public void deconfigure(WebAppContext context) throws Exception { //if we're not persisting the temp dir contents delete it if (!context.isPersistTempDirectory()) { IO.delete(context.getTempDirectory()); } //if it wasn't explicitly configured by the user, then unset it Boolean tmpdirConfigured = (Boolean)context.getAttribute(TEMPDIR_CONFIGURED); if (tmpdirConfigured != null && !tmpdirConfigured) context.setTempDirectory(null); //reset the base resource back to what it was before we did any unpacking of resources if (context.getBaseResource() != null) context.getBaseResource().close(); context.setBaseResource(_preUnpackBaseResource); }