protected void executeScript(Class scriptClass, Permission missingPermission) { try { Script script = InvokerHelper.createScript(scriptClass, new Binding()); script.run(); //InvokerHelper.runScript(scriptClass, null); } catch (AccessControlException ace) { if (missingPermission != null && missingPermission.implies(ace.getPermission())) { return; } else { fail(ace.toString()); } } if (missingPermission != null) { fail("Should catch an AccessControlException"); } }
public long getLastModified() { try { return getFile().lastModified(); } catch (AccessControlException e) { log.finer(e.toString()); return -1; } }
public long getLength() { try { return getFile().length(); } catch (AccessControlException e) { log.finer(e.toString()); return -1; } }
public boolean isDirectory() { try { return getFile().isDirectory(); } catch (AccessControlException e) { log.finer(e.toString()); return false; } }
public long length() { try { return getFile().length(); } catch (AccessControlException e) { log.finer(e.toString()); return -1; } }
@Override public boolean isDirectory() { try { return getFile().isDirectory(); } catch (AccessControlException e) { log.finer(e.toString()); return false; } }
public long getLastModified() { try { return getFile().lastModified(); } catch (AccessControlException e) { log.finer(e.toString()); return -1; } }
public void release() { try { if (hook != null) { Runtime.getRuntime().removeShutdownHook(hook); hook = null; } } catch (IllegalStateException e) { // already shutting down } catch (AccessControlException e) { logger.warn(e.toString(), e); } delete(); }
/** * Returns a list of files in the directory. */ public String []list() throws IOException { try { String []list = getFile().list(); if (list != null) return list; } catch (AccessControlException e) { log.finer(e.toString()); } return new String[0]; }
/** * Returns a list of files in the directory. */ public String []list() throws IOException { try { String []list = getFile().list(); if (list != null) return list; } catch (AccessControlException e) { log.finer(e.toString()); } return new String[0]; }
public void release() { try { if (hook != null) { Runtime.getRuntime().removeShutdownHook(hook); hook = null; } } catch (IllegalStateException e) { // already shutting down } catch (AccessControlException e) { logger.warn(e.toString(), e); } delete(); }
public boolean isFile() { try { if (_isWindows && isAux()) return false; else return getFile().isFile(); } catch (AccessControlException e) { log.finer(e.toString()); return false; } }
public boolean canRead() { try { File file = getFile(); if (_isWindows && isAux()) return false; else return file.canRead(); } catch (AccessControlException e) { log.finer(e.toString()); return false; } }
@Override public boolean exists() { try { if (_isWindows && isAux()) return false; else return getFile().exists(); } catch (AccessControlException e) { log.finer(e.toString()); return false; } }
public boolean canRead() { try { File file = getFile(); if (_isWindows && isAux()) return false; else return file.canRead(); } catch (AccessControlException e) { log.finer(e.toString()); return false; } }
public boolean canWrite() { try { File file = getFile(); if (_isWindows && isAux()) return false; else return file.canWrite(); } catch (AccessControlException e) { log.finer(e.toString()); return false; } }
@Override public boolean isFile() { try { if (_isWindows && isAux()) return false; else return getFile().isFile(); } catch (AccessControlException e) { log.finer(e.toString()); return false; } }
@Override public boolean exists() { try { if (_isWindows && isAux()) return false; else return getFile().exists(); } catch (AccessControlException e) { log.finer(e.toString()); return false; } }
public boolean canWrite() { try { File file = getFile(); if (_isWindows && isAux()) return false; else return file.canWrite(); } catch (AccessControlException e) { log.finer(e.toString()); return false; } }
log.log(Level.WARNING, e.toString(), e);