/** * Get the file represented by this FileResource, ensuring it is not null. * @return the not-null File. * @throws BuildException if file is null. */ protected File getNotNullFile() { if (getFile() == null) { throw new BuildException("file attribute is null!"); } dieOnCircularReference(); return getFile(); }
/** * Return the basedir to which the name is relative. * @return the basedir as File. */ public File getBaseDir() { if (isReference()) { return getCheckedRef().getBaseDir(); } dieOnCircularReference(); return baseDir; }
/** * Fulfill the ResourceCollection contract. * @return whether this Resource is a FileResource. */ @Override public boolean isFilesystemOnly() { if (isReference()) { return getCheckedRef().isFilesystemOnly(); } dieOnCircularReference(); return true; }
/** * Get the file represented by this FileResource. * @return the File. */ @Override public File getFile() { if (isReference()) { return getCheckedRef().getFile(); } dieOnCircularReference(); synchronized (this) { if (file == null) { //try to resolve file set via basedir/name property setters: File d = getBaseDir(); String n = super.getName(); if (n != null) { setFile(FILE_UTILS.resolveFile(d, n)); } } } return file; }