Refine search
private Path createDownloadDir(String workDir, String fileUrl) { Path downloadDirPath = Paths.get(workDir, DOWNLOAD_DIR); File downloadDirFile = downloadDirPath.toFile(); try { Log.info(String.format("Creating download dir %s", downloadDirFile.toPath().toString())); FileUtils.forceMkdir(downloadDirFile); } catch (IOException e) { throw new RuntimeException(String .format("Unable to create download location for archive: %s at %s", fileUrl, downloadDirPath.toString())); } Log.info(String.format("Created download dir %s", downloadDirFile.toPath().toString())); return downloadDirPath; }
public LabeledGroup(Map<String, Object> pool, int index) { super(pool, index, GroupType.LABELED); drillbitLabelExpr = (String) pool.get(DRILLBIT_LABEL); if (drillbitLabelExpr == null) { Log.warn("Labeled pool is missing the drillbit label expression (" + DRILLBIT_LABEL + "), will treat pool as basic."); } }
public URL getAlias() { if (__checkAliases && !_aliasChecked) { try { String abs=_file.getAbsolutePath(); String can=_file.getCanonicalPath(); if (abs.length()!=can.length() || !abs.equals(can)) _alias=new File(can).toURI().toURL(); _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; }
public static void debug(Throwable th) { if (!isDebugEnabled()) return; __log.debug(EXCEPTION,th); unwind(th); }
throws NamingException Name name = ctx.getNameParser("").parse(nameStr); if (name.size() == 0) return null; for (int i=0; i < name.size() - 1; i++) subCtx = (Context)subCtx.lookup (name.get(i)); if(Log.isDebugEnabled())Log.debug("Subcontext "+name.get(i)+" already exists"); subCtx = subCtx.createSubcontext(name.get(i)); if(Log.isDebugEnabled())Log.debug("Subcontext "+name.get(i)+" created"); subCtx.rebind (name.get(name.size() - 1), obj); if(Log.isDebugEnabled())Log.debug("Bound object to "+name.get(name.size() - 1)); return subCtx;
if(Log.isDebugEnabled())Log.debug(">>> new root context requested "); return new javaRootURLContext(env); if(Log.isDebugEnabled())Log.debug(">>> resolution of url "+url+" requested"); Context rootctx = new javaRootURLContext (env); return rootctx.lookup ((String)url); if(Log.isDebugEnabled())Log.debug(">>> resolution of array of urls requested"); String[] urls = (String[])url; Context rootctx = new javaRootURLContext (env); object = rootctx.lookup (urls[i]); if(Log.isDebugEnabled())Log.debug(">>> No idea what to do, so return a new root context anyway"); return new javaRootURLContext (env);
throws NamingException if (name.size() == 0) return; throw new NamingException ("Name is null"); if (cname.size() == 0) throw new NamingException ("Name is empty"); if (cname.size() == 1) if(Log.isDebugEnabled())Log.debug("Checking for existing binding for name="+cname+" for first element of name="+cname.get(0)); String firstComponent = cname.get(0); Log.warn("",e); throw new NamingException (e.getMessage()); ((Context)ctx).unbind (cname.getSuffix(1));
throws NamingException if(Log.isDebugEnabled())Log.debug("list() on Context="+getName()+" for name="+name); Name cname = toCanonicalName(name); if (cname.size() == 0) String firstComponent = cname.get(0); Object ctx = null; if(Log.isDebugEnabled())Log.debug("Dereferencing Reference for "+name.get(0)); try Log.warn("",e); throw new NamingException (e.getMessage()); throw new NotContextException(); return ((Context)ctx).list (cname.getSuffix(1));
if (cname.size() == 0) String firstComponent = cname.get(0); Object ctx = null; Log.warn("",e); throw new NamingException (e.getMessage()); throw new NotContextException(); return ((Context)ctx).listBindings (cname.getSuffix(1));
if (cname.size() == 0) throw new NamingException ("Name is empty"); if (cname.size() == 1) throw new NameAlreadyBoundException (cname.toString()); Context ctx = new NamingContext ((Hashtable)_env.clone(), cname.get(0), this, _parser); addBinding (cname, ctx); return ctx; if(Log.isDebugEnabled())Log.debug("Object bound at "+firstComponent +" is a Reference"); try Log.warn("",e); throw new NamingException (e.getMessage()); return ((Context)ctx).createSubcontext (cname.getSuffix(1));
protected Name stripProtocol (Name name) throws NamingException { if ((name != null) && (name.size() > 0)) { String head = name.get(0); if(Log.isDebugEnabled())Log.debug("Head element of name is: "+head); if (head.startsWith(URL_PREFIX)) { head = head.substring (URL_PREFIX.length()); name.remove(0); if (head.length() > 0) name.add(0, head); if(Log.isDebugEnabled())Log.debug("name modified to "+name.toString()); } } return name; }
protected URL findWebXml() throws IOException, MalformedURLException { String descriptor=getWebAppContext().getDescriptor(); if (descriptor!=null) { Resource web= Resource.newResource(descriptor); if (web.exists()&& !web.isDirectory()) return web.getURL(); } Resource web_inf=getWebAppContext().getWebInf(); if(web_inf!=null && web_inf.isDirectory()) { // do web.xml file Resource web=web_inf.addPath("web.xml"); if(web.exists()) return web.getURL(); Log.debug("No WEB-INF/web.xml in "+getWebAppContext().getWar() +". Serving files and default/dynamic servlets only"); } return null; }
String credentials = request.getHeader(HttpHeaders.AUTHORIZATION); if(Log.isDebugEnabled())Log.debug("Credentials: "+credentials); credentials = credentials.substring(credentials.indexOf(' ')+1); credentials = B64Code.decode(credentials,StringUtil.__ISO_8859_1); Log.warn("AUTH FAILURE: user {}",StringUtil.printable(username)); request.setAuthType(Constraint.__BASIC_AUTH); request.setUserPrincipal(user); Log.warn("AUTH FAILURE: "+e.toString()); Log.ignore(e);
if (_context.isStarted()) if (Log.isDebugEnabled()){Log.debug("Cannot configure webapp after it is started");} return; Resource web_inf=_context.getWebInf(); if (web_inf != null && web_inf.isDirectory() && _context.getClassLoader() instanceof WebAppClassLoader) Resource classes= web_inf.addPath("classes/"); if (classes.exists()) ((WebAppClassLoader)_context.getClassLoader()).addClassPath(classes.toString());
Log.debug(Log.EXCEPTION,e2); throw e; Log.warn("Bad Resource: "+resource); throw e; return newResource(url);
void authenticate(UserRealm realm,Request request) { _userPrincipal = realm.authenticate(_jUserName, _jPassword, request); if (_userPrincipal!=null) _realm=realm; else { Log.warn("AUTH FAILURE: user {}",StringUtil.printable(_jUserName)); request.setUserPrincipal(null); } }
public void lifeCycleStarting( LifeCycle lifecycle ) { if ( lifecycle instanceof ContextHandlerCollection ) { Logger logger = Log.getLogger( getClass().getName() ); Handler[] childHandlers = ((ContextHandlerCollection) lifecycle).getChildHandlers(); if ( childHandlers != null && childHandlers.length > 0 ) { for ( Handler child : childHandlers ) { if ( child instanceof WebAppContext ) { WebAppContext webapp = (WebAppContext) child; if ( logger != null ) { logger.info( "Injecting Plexus container for: {} (context path: {})", webapp.getDisplayName(), webapp.getContextPath() ); } PlexusContainer container = PlexusContainerHolder.get(); webapp.setAttribute( PlexusConstants.PLEXUS_KEY, container ); webapp.setClassLoader( container.getContainerRealm() ); } } } } }
public final void stop() throws Exception { synchronized (_lock) { try { if (_state == STOPPING || _state == STOPPED) return; setStopping(); doStop(); Log.debug("stopped {}",this); setStopped(); } catch (Exception e) { Log.warn("failed " + this,e); setFailed(e); throw e; } catch (Error e) { Log.warn("failed " + this,e); setFailed(e); throw e; } } }
/** * @param resourceBase The base resource as a string. */ public void setResourceBase(String resourceBase) { try { setBaseResource(Resource.newResource(resourceBase)); } catch (Exception e) { Log.warn(e); throw new IllegalArgumentException(resourceBase); } }