/** * Learn whether this file exists. * @return true if this resource exists. */ @Override public boolean isExists() { return isReference() ? getCheckedRef().isExists() : getNotNullFile().exists(); }
/** * Returns the list of files corresponding to the resource collection * * @param resources - A list of {@link ResourceCollection} * @return the list of files corresponding to the resource collection * @throws BuildException */ private List<String> getFiles(List<ResourceCollection> resources) throws BuildException { List<String> files= Lists.newArrayList(); for (ResourceCollection rc : resources) { for (Resource o : rc) { if (o instanceof FileResource) { FileResource fr = ((FileResource) o); if (fr.isDirectory()) { throw new BuildException("Directory based FileResources are not supported."); } if (! fr.isExists()) { log("'" + fr.toLongString() + "' does not exist", Project.MSG_VERBOSE); } files.add(fr.getFile().getAbsolutePath()); } else { log("Unsupported Resource type: " + o.toString(), Project.MSG_VERBOSE); } } } return files; }
/** * Returns the list of files corresponding to the resource collection * * @param resources - A list of {@link ResourceCollection} * @return the list of files corresponding to the resource collection * @throws BuildException */ private List<String> getFiles(List<ResourceCollection> resources) throws BuildException { List<String> files = Lists.newArrayList(); for (ResourceCollection rc : resources) { for (Resource o : rc) { if (o instanceof FileResource) { FileResource fr = ((FileResource) o); if (fr.isDirectory()) { throw new BuildException("Directory based FileResources are not supported."); } if (!fr.isExists()) { log("'" + fr.toLongString() + "' does not exist", Project.MSG_VERBOSE); } files.add(fr.getFile().getAbsolutePath()); } else { log("Unsupported Resource type: " + o.toString(), Project.MSG_VERBOSE); } } } return files; }
for (String fileName : inputFileNames) { FileResource mappedResource = new FileResource(baseDir, fileName); if (mappedResource.isExists()) { mappedResources.add(new TypedResource(mappedResource, inputMapper.getType(), inputMapper.getContentType())); } else {
for (String fileName : inputFileNames) { FileResource mappedResource = new FileResource(baseDir, fileName); if (mappedResource.isExists()) { mappedResources.add(new TypedResource(mappedResource, inputMapper.getType(), inputMapper.getContentType())); } else {