/** * Compare another Object to this FileResource for equality. * @param another the other Object to compare. * @return true if another is a FileResource representing the same file. */ @Override public boolean equals(Object another) { if (this == another) { return true; } if (isReference()) { return getCheckedRef().equals(another); } if (another == null || !(another.getClass().equals(getClass()))) { return false; } FileResource otherfr = (FileResource) another; return getFile() == null ? otherfr.getFile() == null : getFile().equals(otherfr.getFile()) && getName().equals(otherfr.getName()); }
/** * Get the name of this FileResource. If the basedir is set, * the name will be relative to that. Otherwise the basename * only will be returned. * @return the name of this resource. */ @Override public String getName() { if (isReference()) { return getCheckedRef().getName(); } File b = getBaseDir(); return b == null ? getNotNullFile().getName() : FILE_UTILS.removeLeadingPath(b, getNotNullFile()); }
files.add(r.getFile().getAbsolutePath()); } else { files.add(r.getName());
String[] destFilenames = destMapper.mapFileName(fr.getName()); if (destFilenames == null || destFilenames.length != 1) {
String filename = fileResource.getName(); File basedir = fileResource.getBaseDir(); return isSelected(basedir, filename, file);
/** * Compare this FileResource to another Resource. * @param another the other Resource against which to compare. * @return a negative integer, zero, or a positive integer as this FileResource * is less than, equal to, or greater than the specified Resource. */ @Override public int compareTo(Resource another) { if (isReference()) { return getCheckedRef().compareTo(another); } if (this.equals(another)) { return 0; } FileProvider otherFP = another.as(FileProvider.class); if (otherFP != null) { File f = getFile(); if (f == null) { return -1; } File of = otherFP.getFile(); if (of == null) { return 1; } int compareFiles = f.compareTo(of); return compareFiles != 0 ? compareFiles : getName().compareTo(another.getName()); } return super.compareTo(another); }
@Override @SuppressWarnings("unchecked") public void execute() throws BuildException { log("Staging locally (stagingDirectory=" + getStagingDirectory() + ")..."); Iterator<FileResource> files = getFileSet().iterator(); while (files.hasNext()) { final FileResource file = files.next(); stageLocally(file.getBaseDir(), file.getName()); } } }
docMetaData.setDocumentTitle(file.getName()); docMetaData.setDocumentUri(file.toURI().toString() + qualifier); docMetaData.setDocumentId(aFile.getName() + qualifier); if (aFile.getBaseDir() != null) { docMetaData.setDocumentBaseUri(sourceLocation.toURI().toString());
docMetaData.setDocumentTitle(file.getName()); docMetaData.setDocumentUri(file.toURI().toString() + qualifier); docMetaData.setDocumentId(aFile.getName() + qualifier); if (aFile.getBaseDir() != null) { docMetaData.setDocumentBaseUri(sourceLocation.toURI().toString());