private void logMissing(ResourceCollection missing, String what) { if (verbose) { for (Resource r : missing) { log("Expected " + what + " " + r.toLongString() + " is missing."); } } } }
private void logWithModificationTime(Resource r, String what) { log(r.toLongString() + " is " + what + ", modified at " + new Date(r.getLastModified()), verbose ? Project.MSG_INFO : Project.MSG_VERBOSE); }
throw new BuildException("Could not read " + r.toLongString()); "Could not get InputStream from " + r.toLongString(), e);
/** * Add a resource to the source list. * @since Ant 1.7.1 * @param sourceResource the resource to load * @throws BuildException if the resource cannot be read */ public void loadResource(Resource sourceResource) { if (sourceResource instanceof StringResource) { script += ((StringResource) sourceResource).getValue(); return; } if (sourceResource instanceof PropertyResource) { script += ((PropertyResource) sourceResource).getValue(); return; } String name = sourceResource.toLongString(); try (InputStream in = sourceResource.getInputStream()) { readSource(in, name, Charset.defaultCharset()); } catch (IOException e) { throw new BuildException("Failed to open " + name, e); } catch (UnsupportedOperationException e) { throw new BuildException( "Failed to open " + name + " - it is not readable", e); } }
private void nextResource() throws IOException { closeCurrent(); while (iter.hasNext()) { Resource r = iter.next(); if (!r.isExists()) { continue; } log("Concatenating " + r.toLongString(), Project.MSG_VERBOSE); try { currentStream = new BufferedInputStream(r.getInputStream()); return; } catch (IOException eyeOhEx) { if (!ignoreErrors) { log("Failed to get input stream for " + r, Project.MSG_ERR); throw eyeOhEx; } } } eof = true; }
throw new BuildException("Could not read " + r.toLongString()); "Could not get InputStream from " + r.toLongString(), e);
/** * Get a long String representation of this Resource. * This typically should be the value of <code>toString()</code> * prefixed by a type description. * @return this Resource formatted as a long String. * @since Ant 1.7 */ public final String toLongString() { return isReference() ? getCheckedRef().toLongString() : getDataTypeName() + " \"" + toString() + '"'; }
boolean isSelected = isSelected(tmpFile.getParentFile(), tmpFile.getName(), resource.toLongString()); tmpFile.delete(); return isSelected;
if (!r.isExists()) { final String message = "Warning: Could not find resource " + r.toLongString() + " to copy."; if (!failonerror) { if (!quiet) {
if (!r.isExists()) { throw new BuildException("Could not find resource %s to scp.", r.toLongString()); if (fp == null) { throw new BuildException("Resource %s is not a file.", r.toLongString()); if (baseDir == null) { throw new BuildException("basedir for resource %s is undefined.", r.toLongString());
_error ("Could not find resource " + aRes.toLongString () + " to copy."); continue; _error ("Could not resolve resource " + aRes.toLongString () + " to a file.");