@SuppressWarnings("rawtypes") @Delegate( interfaceName = "com.ocean.FttpWorker", methodName = "getFileMeta", policy = DelegatePolicy.Implements) public FileResult getFileProperty(String f) throws RemoteException, FttpException { // System.out.println("f:"+f); FileResult fr = new FileResult(); FileAdapter fa = new FileAdapter(f); try { fr.setObj("exists", new Boolean(fa.exists())); fr.setObj("isFile", new Boolean(fa.isFile())); fr.setObj("isDirectory", new Boolean(fa.isDirectory())); fr.setObj("isHidden", new Boolean(fa.isHidden())); fr.setObj("canRead", new Boolean(fa.canRead())); fr.setObj("canWrite", new Boolean(fa.canWrite())); fr.setString("getName", fa.getName()); fr.setString( "getParent", fa.getParentFile() != null ? fa.getParentFile().toURI().getPath() : null); // fa.getParent() fr.setString("getPath", fa.toURI().getPath()); // fa.getPath() // System.out.println("getPath:"+fa.toURI().getPath()); fr.setObj("lastModified", new Long(fa.lastModified())); fr.setObj("length", new Long(fa.length())); fr.setObj("list", f.length() > 0 ? fa.list() : getListRoots()); } catch (Exception e) { // LogUtil.info("getFileProperty", "exception", e); fa.close(); throw new FttpException(e); } fa.close(); return fr; }