public static boolean existsFile(String filePath) { FileObject fileObject = VFS.resolveFile(filePath); if (fileObject.isExist()) { return true; } return false; }
public int compare(FileObject o1, FileObject o2) { if (o1.getLastModifiedTime() > o2.getLastModifiedTime()) { return -1; } else if (o1.getLastModifiedTime() < o2.getLastModifiedTime()) { return 1; } return 0; }
public FileObjectPart(FileObject partSource) { this(partSource.getFileName(), partSource, null, null); }
public FileObject getRootFileObject(String path) { String fullPath = getFileObject(path).getAbsolutePath(); return VFS.resolveFile(fullPath.substring(0, fullPath.length() - path.length() + 1)); }
public boolean isMatch(FileObject fileObject){ if (fileObject.getFileName() .endsWith(PROPERTIES_FILE_EXTENSION) && fileObject.getParent().getFileName() .equals(I18N_FOLDER_NAME)) { return true; } return false; }
public static void loadDict(List<FileObject> fileObjects, String encode) { for (FileObject f : fileObjects) { loadPinYinFile(f.getInputStream(), encode); } initCharacter(); }
protected static String getJarFileName(FileObject fileObject) { if (fileObject != null) { String path = fileObject.getAbsolutePath(); int n = path.lastIndexOf("!"); if (n != -1) { return path.substring(0, n); } else { return path; } } return null; }
public long getLastModified(Resource resource) { long lastModifiedTime = VFS.resolveFile(resource.getName()) .getLastModifiedTime(); resourceModifiedTimeMap.put(resource.getName(), lastModifiedTime); return lastModifiedTime; }
private void refreshScanPath() { Set<FileObject> classPaths = new HashSet<FileObject>(); for (String file : allScanningPath) { FileObject fileObject = VFS.resolveFile(file); if (fileObject.isExist() && fileObject.getSchemaProvider().getSchema().equals("file:")) { classPaths.add(fileObject); } } resolveClassPaths(classPaths); resolveDeletedFile(); }
public boolean isMatch(FileObject fileObject) { if (extFileContentTypeMap.containsKey(fileObject.getExtName())) { return true; } return false; }
/** * 对当前层级的TinyClassLoader中的FileObject对象进行过滤 * * @param fileObjectFilter * @param fileObjectProcessor */ public void foreach(FileObjectFilter fileObjectFilter, FileObjectProcessor fileObjectProcessor) { if (fileObjects != null) { for (FileObject fileObject : fileObjects) { fileObject.foreach(fileObjectFilter, fileObjectProcessor); } } }
protected long lengthOfData() throws IOException { return source.getSize(); }
public FileObjectPart(FileObject partSource, String contentType, String charset) { this(partSource.getFileName(), partSource, contentType, charset); }
public FileObject getRootFileObject(String path) { String fullPath = getFileObject(path).getAbsolutePath(); return VFS.resolveFile(fullPath.substring(0, fullPath.length() - path.length() + 1)); }
public long getLastModified(Resource resource) { long lastModifiedTime = VFS.resolveFile(resource.getName()) .getLastModifiedTime(); resourceModifiedTimeMap.put(resource.getName(), lastModifiedTime); return lastModifiedTime; }
public void execute(Context context) { LOGGER.logMessage(LogLevel.INFO, "文件存在判断组件开始执行"); int code = FlowComponentConstants.DEFAULT_CODE; FileObject fileObject = VFS.resolveFile(filePath); if (fileObject.isExist()) { code = FlowComponentConstants.EXIST_CODE; } context.put(resultKey, code); LOGGER.logMessage(LogLevel.INFO, "文件存在判断组件执行结束"); }
protected boolean checkMatch(FileObject fileObject) { boolean isMatch = false; if (fileObject.getFileName().endsWith(CLASS_EXT_FILENAME)) { isMatch = true; } return isMatch; }
public boolean isSourceModified(Resource resource) { Long oldTime = resourceModifiedTimeMap.get(resource.getName()); if (oldTime == null || oldTime != getLastModified(resource)) { return true; } long lastModifiedTime = VFS.resolveFile(resource.getName()) .getLastModifiedTime(); return oldTime == lastModifiedTime; }
public boolean isMatch(FileObject fileObject) { for (String fileExtName : extNameList) { if (fileObject.getFileName().endsWith(fileExtName)) { return true; } } return false; }
public boolean accept(FileObject fileObject) { String name = fileObject.getFileName(); return (templateExtName != null && name .endsWith(templateExtName)) || (layoutExtName != null && name .endsWith(layoutExtName)) || (componentExtName != null && name .endsWith(componentExtName)); } }, new FileObjectProcessor() {