@Test public void testSetCurrentDirectory() throws Exception { }
public final synchronized void setCurrentDirectory(String currentDirectory) { if ( ! FileUtils.exists(currentDirectory)) { return; } String newDir = FileUtils.normalize(currentDirectory); FileACL acl = new FileACL(Paths.get(newDir)); if (KernelThread.currentKernelThread().isPrivileged() || acl.canRead()) { this.currentDirectory = FileUtils.normalize(newDir); } else { throw new SecurityException("cannot access."); } }
KernelThread { public final synchronized void setCurrentDirectory(String currentDirectory) { if ( ! FileUtils.exists(currentDirectory)) { return; } String newDir = FileUtils.normalize(currentDirectory); FileACL acl = new FileACL(Paths.get(newDir)); if (KernelThread.currentKernelThread().isPrivileged() || acl.canRead()) { this.currentDirectory = FileUtils.normalize(newDir); } else { throw new SecurityException("cannot access."); } } }
KernelThread { public final synchronized void setCurrentDirectory(String currentDirectory) { if ( ! FileUtils.exists(currentDirectory)) { return; } String newDir = FileUtils.normalize(currentDirectory); FileACL acl = new FileACL(Paths.get(newDir)); if (KernelThread.currentKernelThread().isPrivileged() || acl.canRead()) { this.currentDirectory = FileUtils.normalize(newDir); } else { throw new SecurityException("cannot access."); } } KernelThread(Thread thread); }
KernelThread { public final synchronized void setCurrentDirectory(String currentDirectory) { if ( ! FileUtils.exists(currentDirectory)) { return; } String newDir = FileUtils.normalize(currentDirectory); FileACL acl = new FileACL(Paths.get(newDir)); if (KernelThread.currentKernelThread().isPrivileged() || acl.canRead()) { this.currentDirectory = FileUtils.normalize(newDir); } else { throw new SecurityException("cannot access."); } } KernelThread(Thread thread); Thread getThread(); synchronized boolean isPrivileged(); static KernelThread getKernelThread(Thread t); static KernelThread currentKernelThread(); static void initSysCalls(List<Class> classes); synchronized User getUser(); synchronized void setUser(User user); static void doSysCall(Object obj, Method methodToCall, Object... args); final static Method getSysCallMethod(Class targetClass, String name); final synchronized String getCurrentDirectory(); final synchronized void setCurrentDirectory(String currentDirectory); }
KernelThread { public final synchronized void setCurrentDirectory(String currentDirectory) { if ( ! FileUtils.exists(currentDirectory)) { return; } String newDir = FileUtils.normalize(currentDirectory); FileACL acl = new FileACL(Paths.get(newDir)); if (KernelThread.currentKernelThread().isPrivileged() || acl.canRead()) { this.currentDirectory = FileUtils.normalize(newDir); } else { throw new SecurityException("cannot access."); } } KernelThread(Thread thread); Thread getThread(); synchronized boolean isPrivileged(); static KernelThread getKernelThread(Thread t); static KernelThread currentKernelThread(); static void initSysCalls(List<Class> classes); synchronized User getUser(); synchronized void setUser(User user); static void doSysCall(Object obj, Method methodToCall, Object... args); final static Method getSysCallMethod(Class targetClass, String name); final synchronized String getCurrentDirectory(); final synchronized void setCurrentDirectory(String currentDirectory);  }