You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by jl...@apache.org on 2014/01/14 09:27:43 UTC
svn commit: r1557968 [14/26] - in /ant/ivy/core/trunk:
src/java/org/apache/ivy/ src/java/org/apache/ivy/ant/
src/java/org/apache/ivy/core/ src/java/org/apache/ivy/core/cache/
src/java/org/apache/ivy/core/check/ src/java/org/apache/ivy/core/deliver/
src...
Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/report/XmlReportWriter.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/report/XmlReportWriter.java?rev=1557968&r1=1557967&r2=1557968&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/report/XmlReportWriter.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/report/XmlReportWriter.java Tue Jan 14 08:27:37 2014
@@ -46,27 +46,26 @@ import org.apache.ivy.util.StringUtils;
import org.apache.ivy.util.XMLHelper;
/**
- * XmlReportWriter allows to write ResolveReport in an xml format.
+ * XmlReportWriter allows to write ResolveReport in an xml format.
*/
public class XmlReportWriter {
-
+
static final String REPORT_ENCODING = "UTF-8";
public void output(ConfigurationResolveReport report, OutputStream stream) {
output(report, new String[] {report.getConfiguration()}, stream);
}
- public void output(
- ConfigurationResolveReport report, String[] confs, OutputStream stream) {
+ public void output(ConfigurationResolveReport report, String[] confs, OutputStream stream) {
OutputStreamWriter encodedOutStream;
try {
- encodedOutStream = new OutputStreamWriter(stream , REPORT_ENCODING);
+ encodedOutStream = new OutputStreamWriter(stream, REPORT_ENCODING);
} catch (UnsupportedEncodingException e) {
- throw new RuntimeException(REPORT_ENCODING + " is not known on your jvm" , e);
+ throw new RuntimeException(REPORT_ENCODING + " is not known on your jvm", e);
}
PrintWriter out = new PrintWriter(new BufferedWriter(encodedOutStream));
ModuleRevisionId mrid = report.getModuleDescriptor().getModuleRevisionId();
- //out.println("<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>");
+ // out.println("<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>");
out.println("<?xml version=\"1.0\" encoding=\"" + REPORT_ENCODING + "\"?>");
out.println("<?xml-stylesheet type=\"text/xsl\" href=\"ivy-report.xsl\"?>");
out.println("<ivy-report version=\"1.0\">");
@@ -80,8 +79,8 @@ public class XmlReportWriter {
Map extraAttributes = mrid.getExtraAttributes();
for (Iterator it = extraAttributes.entrySet().iterator(); it.hasNext();) {
Map.Entry entry = (Entry) it.next();
- out.println("\t\textra-" + entry.getKey()
- + "=\"" + XMLHelper.escape(entry.getValue().toString()) + "\"");
+ out.println("\t\textra-" + entry.getKey() + "=\""
+ + XMLHelper.escape(entry.getValue().toString()) + "\"");
}
out.println("\t\tconf=\"" + XMLHelper.escape(report.getConfiguration()) + "\"");
out.println("\t\tconfs=\"" + XMLHelper.escape(StringUtils.join(confs, ", ")) + "\"");
@@ -94,9 +93,8 @@ public class XmlReportWriter {
for (Iterator iter = report.getModuleIds().iterator(); iter.hasNext();) {
ModuleId mid = (ModuleId) iter.next();
- out.println("\t\t<module organisation=\""
- + XMLHelper.escape(mid.getOrganisation()) + "\"" + " name=\""
- + XMLHelper.escape(mid.getName()) + "\">");
+ out.println("\t\t<module organisation=\"" + XMLHelper.escape(mid.getOrganisation())
+ + "\"" + " name=\"" + XMLHelper.escape(mid.getName()) + "\">");
for (Iterator it2 = report.getNodes(mid).iterator(); it2.hasNext();) {
IvyNode dep = (IvyNode) it2.next();
ouputRevision(report, out, dependencies, dep);
@@ -122,39 +120,37 @@ public class XmlReportWriter {
details.append("\" pubdate=\"");
details.append(DateUtil.format(new Date(dep.getPublication())));
details.append("\" resolver=\"");
- details.append(XMLHelper.escape(
- dep.getModuleRevision().getResolver().getName()));
+ details.append(XMLHelper.escape(dep.getModuleRevision().getResolver().getName()));
details.append("\" artresolver=\"");
- details.append(XMLHelper.escape(
- dep.getModuleRevision().getArtifactResolver().getName()));
+ details.append(XMLHelper
+ .escape(dep.getModuleRevision().getArtifactResolver().getName()));
details.append("\"");
}
if (dep.isEvicted(report.getConfiguration())) {
EvictionData ed = dep.getEvictedData(report.getConfiguration());
if (ed.getConflictManager() != null) {
- details.append(" evicted=\"").append(
- XMLHelper.escape(ed.getConflictManager().toString())).append("\"");
+ details.append(" evicted=\"")
+ .append(XMLHelper.escape(ed.getConflictManager().toString())).append("\"");
} else {
details.append(" evicted=\"transitive\"");
}
details.append(" evicted-reason=\"")
- .append(XMLHelper.escape(ed.getDetail() == null ? "" : ed.getDetail()))
- .append("\"");
+ .append(XMLHelper.escape(ed.getDetail() == null ? "" : ed.getDetail()))
+ .append("\"");
}
if (dep.hasProblem()) {
- details.append(" error=\"").append(
- XMLHelper.escape(dep.getProblem().getMessage())).append("\"");
+ details.append(" error=\"").append(XMLHelper.escape(dep.getProblem().getMessage()))
+ .append("\"");
}
if (md != null && md.getHomePage() != null) {
- details.append(" homepage=\"").append(
- XMLHelper.escape(md.getHomePage())).append("\"");
+ details.append(" homepage=\"").append(XMLHelper.escape(md.getHomePage())).append("\"");
}
extraAttributes = md != null ? md.getExtraAttributes() : dep.getResolvedId()
.getExtraAttributes();
for (Iterator iterator = extraAttributes.keySet().iterator(); iterator.hasNext();) {
String attName = (String) iterator.next();
- details.append(" extra-").append(attName).append("=\"").append(
- XMLHelper.escape(extraAttributes.get(attName).toString())).append("\"");
+ details.append(" extra-").append(attName).append("=\"")
+ .append(XMLHelper.escape(extraAttributes.get(attName).toString())).append("\"");
}
String defaultValue = dep.getDescriptor() != null ? " default=\""
+ dep.getDescriptor().isDefault() + "\"" : "";
@@ -163,10 +159,9 @@ public class XmlReportWriter {
+ XMLHelper.escape(dep.getResolvedId().getRevision())
+ "\""
+ (dep.getResolvedId().getBranch() == null ? "" : " branch=\""
- + XMLHelper.escape(
- dep.getResolvedId().getBranch()) + "\"") + details
- + " downloaded=\"" + dep.isDownloaded() + "\"" + " searched=\""
- + dep.isSearched() + "\"" + defaultValue + " conf=\""
+ + XMLHelper.escape(dep.getResolvedId().getBranch()) + "\"") + details
+ + " downloaded=\"" + dep.isDownloaded() + "\"" + " searched=\"" + dep.isSearched()
+ + "\"" + defaultValue + " conf=\""
+ toString(dep.getConfigurations(report.getConfiguration())) + "\""
+ " position=\"" + position + "\">");
if (md != null) {
@@ -178,9 +173,8 @@ public class XmlReportWriter {
} else {
lurl = "";
}
- out.println("\t\t\t\t<license name=\""
- + XMLHelper.escape(licenses[i].getName()) + "\""
- + lurl + "/>");
+ out.println("\t\t\t\t<license name=\"" + XMLHelper.escape(licenses[i].getName())
+ + "\"" + lurl + "/>");
}
}
outputMetadataArtifact(out, dep);
@@ -209,29 +203,28 @@ public class XmlReportWriter {
if (dep.getModuleRevision() != null) {
MetadataArtifactDownloadReport madr = dep.getModuleRevision().getReport();
out.print("\t\t\t\t<metadata-artifact");
- out.print(" status=\""
- + XMLHelper.escape(madr.getDownloadStatus().toString()) + "\"");
+ out.print(" status=\"" + XMLHelper.escape(madr.getDownloadStatus().toString()) + "\"");
out.print(" details=\"" + XMLHelper.escape(madr.getDownloadDetails()) + "\"");
out.print(" size=\"" + madr.getSize() + "\"");
out.print(" time=\"" + madr.getDownloadTimeMillis() + "\"");
if (madr.getLocalFile() != null) {
- out.print(" location=\""
- + XMLHelper.escape(madr.getLocalFile().getAbsolutePath()) + "\"");
+ out.print(" location=\"" + XMLHelper.escape(madr.getLocalFile().getAbsolutePath())
+ + "\"");
}
out.print(" searched=\"" + madr.isSearched() + "\"");
if (madr.getOriginalLocalFile() != null) {
- out.print(" original-local-location=\""
- + XMLHelper.escape(madr.getOriginalLocalFile().getAbsolutePath()) + "\"");
+ out.print(" original-local-location=\""
+ + XMLHelper.escape(madr.getOriginalLocalFile().getAbsolutePath()) + "\"");
}
ArtifactOrigin origin = madr.getArtifactOrigin();
if (origin != null) {
- out.print(" origin-is-local=\"" + String.valueOf(origin.isLocal()) + "\"");
+ out.print(" origin-is-local=\"" + String.valueOf(origin.isLocal()) + "\"");
out.print(" origin-location=\"" + XMLHelper.escape(origin.getLocation()) + "\"");
}
out.println("/>");
-
+
}
}
@@ -239,39 +232,35 @@ public class XmlReportWriter {
Caller[] callers = dep.getCallers(report.getConfiguration());
for (int i = 0; i < callers.length; i++) {
StringBuffer callerDetails = new StringBuffer();
- Map callerExtraAttributes = callers[i].getDependencyDescriptor()
- .getExtraAttributes();
- for (Iterator iterator = callerExtraAttributes.keySet().iterator(); iterator
- .hasNext();) {
+ Map callerExtraAttributes = callers[i].getDependencyDescriptor().getExtraAttributes();
+ for (Iterator iterator = callerExtraAttributes.keySet().iterator(); iterator.hasNext();) {
String attName = (String) iterator.next();
- callerDetails.append(" extra-").append(attName).append("=\"").append(
- XMLHelper.escape(
- callerExtraAttributes.get(attName).toString())).append("\"");
+ callerDetails.append(" extra-").append(attName).append("=\"")
+ .append(XMLHelper.escape(callerExtraAttributes.get(attName).toString()))
+ .append("\"");
}
out.println("\t\t\t\t<caller organisation=\""
- + XMLHelper.escape(
- callers[i].getModuleRevisionId().getOrganisation()) + "\""
- + " name=\""
- + XMLHelper.escape(
- callers[i].getModuleRevisionId().getName()) + "\""
- + " conf=\""
- + XMLHelper.escape(
- toString(callers[i].getCallerConfigurations())) + "\""
- + " rev=\""
- + XMLHelper.escape(
- callers[i].getAskedDependencyId(dep.getData()).getRevision()) + "\""
- + " rev-constraint-default=\""
- + XMLHelper.escape(
- callers[i].getDependencyDescriptor()
- .getDependencyRevisionId().getRevision()) + "\""
- + " rev-constraint-dynamic=\""
- + XMLHelper.escape(
- callers[i].getDependencyDescriptor()
+ + XMLHelper.escape(callers[i].getModuleRevisionId().getOrganisation())
+ + "\""
+ + " name=\""
+ + XMLHelper.escape(callers[i].getModuleRevisionId().getName())
+ + "\""
+ + " conf=\""
+ + XMLHelper.escape(toString(callers[i].getCallerConfigurations()))
+ + "\""
+ + " rev=\""
+ + XMLHelper.escape(callers[i].getAskedDependencyId(dep.getData()).getRevision())
+ + "\""
+ + " rev-constraint-default=\""
+ + XMLHelper.escape(callers[i].getDependencyDescriptor()
+ .getDependencyRevisionId().getRevision())
+ + "\""
+ + " rev-constraint-dynamic=\""
+ + XMLHelper.escape(callers[i].getDependencyDescriptor()
.getDynamicConstraintDependencyRevisionId().getRevision()) + "\""
- + " callerrev=\""
- + XMLHelper.escape(
- callers[i].getModuleRevisionId().getRevision()) + "\""
+ + " callerrev=\""
+ + XMLHelper.escape(callers[i].getModuleRevisionId().getRevision()) + "\""
+ callerDetails + "/>");
}
}
@@ -281,31 +270,26 @@ public class XmlReportWriter {
ArtifactDownloadReport[] adr = report.getDownloadReports(dep.getResolvedId());
out.println("\t\t\t\t<artifacts>");
for (int i = 0; i < adr.length; i++) {
- out.print("\t\t\t\t\t<artifact name=\""
- + XMLHelper.escape(adr[i].getName())
- + "\" type=\"" + XMLHelper.escape(adr[i].getType())
- + "\" ext=\"" + XMLHelper.escape(adr[i].getExt()) + "\"");
+ out.print("\t\t\t\t\t<artifact name=\"" + XMLHelper.escape(adr[i].getName())
+ + "\" type=\"" + XMLHelper.escape(adr[i].getType()) + "\" ext=\""
+ + XMLHelper.escape(adr[i].getExt()) + "\"");
extraAttributes = adr[i].getArtifact().getExtraAttributes();
- for (Iterator iterator = extraAttributes.keySet().iterator(); iterator
- .hasNext();) {
+ for (Iterator iterator = extraAttributes.keySet().iterator(); iterator.hasNext();) {
String attName = (String) iterator.next();
- out.print(" extra-" + attName + "=\""
- + XMLHelper.escape(extraAttributes.get(attName).toString())
- + "\"");
+ out.print(" extra-" + attName + "=\""
+ + XMLHelper.escape(extraAttributes.get(attName).toString()) + "\"");
}
- out.print(" status=\""
- + XMLHelper.escape(adr[i].getDownloadStatus().toString()) + "\"");
+ out.print(" status=\"" + XMLHelper.escape(adr[i].getDownloadStatus().toString()) + "\"");
out.print(" details=\"" + XMLHelper.escape(adr[i].getDownloadDetails()) + "\"");
out.print(" size=\"" + adr[i].getSize() + "\"");
out.print(" time=\"" + adr[i].getDownloadTimeMillis() + "\"");
if (adr[i].getLocalFile() != null) {
- out.print(" location=\""
- + XMLHelper.escape(adr[i].getLocalFile().getAbsolutePath()) + "\"");
+ out.print(" location=\""
+ + XMLHelper.escape(adr[i].getLocalFile().getAbsolutePath()) + "\"");
}
if (adr[i].getUnpackedLocalFile() != null) {
out.print(" unpackedFile=\""
- + XMLHelper.escape(adr[i].getUnpackedLocalFile().getAbsolutePath())
- + "\"");
+ + XMLHelper.escape(adr[i].getUnpackedLocalFile().getAbsolutePath()) + "\"");
}
ArtifactOrigin origin = adr[i].getArtifactOrigin();
Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/Repository.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/Repository.java?rev=1557968&r1=1557967&r2=1557968&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/Repository.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/Repository.java Tue Jan 14 08:27:37 2014
@@ -26,8 +26,7 @@ import org.apache.ivy.core.module.descri
/**
* Represents a collection of resources available to Ivy. Ivy uses one or more repositories as both
* a source of resources for Ivy enabled build systems and as a distribution center for resources
- * generated by Ivy enabled build systems.
- * </p>
+ * generated by Ivy enabled build systems. </p>
* <p>
* A repository supports the following fundamental operations
* <ul>
@@ -36,20 +35,15 @@ import org.apache.ivy.core.module.descri
* <li>retrieving a listing of resources.</li>
* </ul>
* </p>
- * <h4>Resource Retrieval</h4>
- * </p>
+ * <h4>Resource Retrieval</h4> </p>
* <p>
* {@link #get} retrieves a resource specified by a provided identifier creating a new file .
* </p>
- * </p>
- * <h4>resource Publication</h4>
- * </p>
+ * </p> <h4>resource Publication</h4> </p>
* <p>
* {@link #put} transfers a file to the repository.
* </p>
- * </p>
- * <h4>resource Listing</h4>
- * </p>
+ * </p> <h4>resource Listing</h4> </p>
* <p>
* {@link #list} returns a listing of file like objects belonging to a specified parent directory.
* </p>
Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/Resource.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/Resource.java?rev=1557968&r1=1557967&r2=1557968&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/Resource.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/Resource.java Tue Jan 14 08:27:37 2014
@@ -29,15 +29,14 @@ import java.io.InputStream;
* <li>size of the resource in bytes.</li>
* <li>if the resource is available.</li>
* </ul>
- * </p>
- * <h4>Implementation Notes</h4>
- * In implementing the interface you need to ensure the following behaviors:
+ * </p> <h4>Implementation Notes</h4> In implementing the interface you need to ensure the following
+ * behaviors:
* <ul>
- * <li>All of the methods specified in the interface fail by returning an empty value
- * (<code>false</code>, <code>0</code>, <code>""</code>).
- * In other words, the specified interface methods should not throw RuntimeExceptions. </li>
+ * <li>All of the methods specified in the interface fail by returning an empty value (
+ * <code>false</code>, <code>0</code>, <code>""</code>). In other words, the specified interface
+ * methods should not throw RuntimeExceptions.</li>
* <li>Failure conditions should be logged using the {@link org.apache.ivy.util.Message#verbose}
- * method. </li>
+ * method.</li>
* <li>Failure of one of the interface's specified methods results in all other interface specified
* methods returning an empty value (<code>false</code>, <code>0</code>, <code>""</code>).</li>
* </ul>
@@ -55,9 +54,9 @@ public interface Resource {
/**
* Get the date the resource was last modified
*
- * @return A <code>long</code> value representing the time the file was last modified,
- * measured in milliseconds since the epoch (00:00:00 GMT, January 1, 1970), or
- * <code>0L</code> if the file does not exist or if an I/O error occurs.
+ * @return A <code>long</code> value representing the time the file was last modified, measured
+ * in milliseconds since the epoch (00:00:00 GMT, January 1, 1970), or <code>0L</code>
+ * if the file does not exist or if an I/O error occurs.
*/
public long getLastModified();
@@ -69,9 +68,8 @@ public interface Resource {
public long getContentLength();
/**
- * Determine if the resource is available.
- * </p>
- * Note that this method only checks for availability, not for actual existence.
+ * Determine if the resource is available. </p> Note that this method only checks for
+ * availability, not for actual existence.
*
* @return <code>boolean</code> value indicating if the resource is available.
*/
Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/ResourceHelper.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/ResourceHelper.java?rev=1557968&r1=1557967&r2=1557968&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/ResourceHelper.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/ResourceHelper.java Tue Jan 14 08:27:37 2014
@@ -25,11 +25,11 @@ import org.apache.ivy.plugins.repository
import org.apache.ivy.util.Message;
public final class ResourceHelper {
-
+
private ResourceHelper() {
-
+
}
-
+
public static boolean equals(Resource res, File f) {
if (res == null && f == null) {
return true;
Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/TransferEvent.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/TransferEvent.java?rev=1557968&r1=1557967&r2=1557968&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/TransferEvent.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/TransferEvent.java Tue Jan 14 08:27:37 2014
@@ -41,7 +41,7 @@ import org.apache.ivy.core.event.IvyEven
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
- *
+ *
* </pre>
*
* Orginal class written by Michal Maczka.
@@ -76,7 +76,7 @@ public class TransferEvent extends IvyEv
* Used to check event type validity: should always be 0 <= type <= LAST_EVENT_TYPE
*/
private static final int LAST_EVENT_TYPE = TRANSFER_ERROR;
-
+
/**
* Indicates GET transfer (from the repository)
*/
@@ -114,7 +114,7 @@ public class TransferEvent extends IvyEv
private long totalLength;
private boolean isTotalLengthSet = false;
-
+
/**
* This attribute is used to store the time at which the event enters a type.
* <p>
@@ -198,7 +198,8 @@ public class TransferEvent extends IvyEv
* @param requestType
* The requestType to set. The Request type value should be either
* <code>TransferEvent.REQUEST_GET<code> or <code>TransferEvent.REQUEST_PUT<code>.
- * @throws IllegalArgumentException when
+ * @throws IllegalArgumentException
+ * when
*/
protected void setRequestType(final int requestType) {
switch (requestType) {
@@ -233,10 +234,10 @@ public class TransferEvent extends IvyEv
this.eventType = eventType;
timeTracking[eventType] = System.currentTimeMillis();
if (eventType > TRANSFER_INITIATED) {
- addAttribute("total-duration",
+ addAttribute("total-duration",
String.valueOf(getElapsedTime(TRANSFER_INITIATED, eventType)));
if (eventType > TRANSFER_STARTED) {
- addAttribute("duration",
+ addAttribute("duration",
String.valueOf(getElapsedTime(TRANSFER_STARTED, eventType)));
}
}
@@ -294,7 +295,7 @@ public class TransferEvent extends IvyEv
public void setTotalLengthSet(boolean isTotalLengthSet) {
this.isTotalLengthSet = isTotalLengthSet;
}
-
+
public Repository getRepository() {
return repository;
}
@@ -304,9 +305,11 @@ public class TransferEvent extends IvyEv
* another event time.
* <p>
* This is especially useful to get the elapsed transfer time:
+ *
* <pre>
* getElapsedTime(TransferEvent.TRANSFER_STARTED, TransferEvent.TRANSFER_COMPLETED);
* </pre>
+ *
* </p>
* <p>
* Special cases:
Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/file/FileRepository.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/file/FileRepository.java?rev=1557968&r1=1557967&r2=1557968&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/file/FileRepository.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/file/FileRepository.java Tue Jan 14 08:27:37 2014
@@ -57,7 +57,7 @@ public class FileRepository extends Abst
fireTransferInitiated(getResource(destination), TransferEvent.REQUEST_PUT);
copy(source, getFile(destination), overwrite);
}
-
+
public void move(File src, File dest) throws IOException {
if (!src.renameTo(dest)) {
throw new IOException("impossible to move '" + src + "' to '" + dest + "'");
@@ -130,7 +130,7 @@ public class FileRepository extends Abst
public File getBaseDir() {
return baseDir;
}
-
+
public final void setBaseDir(File baseDir) {
Checks.checkAbsolute(baseDir, "basedir");
this.baseDir = baseDir;
Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/sftp/SFTPRepository.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/sftp/SFTPRepository.java?rev=1557968&r1=1557967&r2=1557968&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/sftp/SFTPRepository.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/sftp/SFTPRepository.java Tue Jan 14 08:27:37 2014
@@ -123,10 +123,10 @@ public class SFTPRepository extends Abst
throw ex;
} catch (URISyntaxException e) {
IOException ex = new IOException("impossible to open stream for " + resource + " on "
- + getHost() + (e.getMessage() != null ? ": " + e.getMessage() : ""));
+ + getHost() + (e.getMessage() != null ? ": " + e.getMessage() : ""));
ex.initCause(e);
throw ex;
- }
+ }
}
public void get(String source, File destination) throws IOException {
@@ -142,7 +142,7 @@ public class SFTPRepository extends Abst
throw ex;
} catch (URISyntaxException e) {
IOException ex = new IOException("impossible to get " + source + " on " + getHost()
- + (e.getMessage() != null ? ": " + e.getMessage() : ""));
+ + (e.getMessage() != null ? ": " + e.getMessage() : ""));
ex.initCause(e);
throw ex;
}
@@ -229,7 +229,7 @@ public class SFTPRepository extends Abst
IOException ex = new IOException("Failed to return a listing for '" + parent + "'");
ex.initCause(usex);
throw ex;
- }
+ }
return null;
}
Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/ssh/AbstractSshBasedRepository.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/ssh/AbstractSshBasedRepository.java?rev=1557968&r1=1557967&r2=1557968&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/ssh/AbstractSshBasedRepository.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/ssh/AbstractSshBasedRepository.java Tue Jan 14 08:27:37 2014
@@ -53,14 +53,12 @@ public abstract class AbstractSshBasedRe
super();
}
-
/**
- * hashmap of user/hosts with credentials.
- * key is hostname, value is Credentials
+ * hashmap of user/hosts with credentials. key is hostname, value is Credentials
**/
private static HashMap credentialsCache = new HashMap();
- private static final int MAX_CREDENTILAS_CACHE_SIZE = 100;
+ private static final int MAX_CREDENTILAS_CACHE_SIZE = 100;
/**
* get a new session using the default attributes if the given String is a full uri, use the
@@ -95,17 +93,17 @@ public abstract class AbstractSshBasedRe
}
if (host == null) {
throw new IllegalArgumentException(
- "missing host information. host should be provided either "
- + "directly on the repository or in the connection URI");
+ "missing host information. host should be provided either "
+ + "directly on the repository or in the connection URI");
}
if (user == null) {
- Credentials c = requestCredentials(host);
- if (c != null) {
- user = c.getUserName();
- userPassword = c.getPasswd();
- } else {
- Message.error("username is not set");
- }
+ Credentials c = requestCredentials(host);
+ if (c != null) {
+ user = c.getUserName();
+ userPassword = c.getPasswd();
+ } else {
+ Message.error("username is not set");
+ }
}
return SshCache.getInstance().getSession(host, port, user, userPassword, getKeyFile(),
getKeyFilePassword(), getPassFile(), isAllowedAgentUse());
@@ -121,8 +119,9 @@ public abstract class AbstractSshBasedRe
private URI parseURI(String source) {
try {
URI uri = new URI(source);
- if (uri.getScheme() != null && !uri.getScheme().toLowerCase(Locale.US).equals(
- getRepositoryScheme().toLowerCase(Locale.US))) {
+ if (uri.getScheme() != null
+ && !uri.getScheme().toLowerCase(Locale.US)
+ .equals(getRepositoryScheme().toLowerCase(Locale.US))) {
throw new URISyntaxException(source, "Wrong scheme in URI. Expected "
+ getRepositoryScheme() + " as scheme!");
}
@@ -132,43 +131,42 @@ public abstract class AbstractSshBasedRe
if (uri.getPath() == null) {
throw new URISyntaxException(source, "Missing path in URI");
}
- //if (uri.getUserInfo() == null && getUser() == null) {
- // throw new URISyntaxException(source, "Missing username in URI or in resolver");
- //}
+ // if (uri.getUserInfo() == null && getUser() == null) {
+ // throw new URISyntaxException(source, "Missing username in URI or in resolver");
+ // }
return uri;
} catch (URISyntaxException e) {
Message.error(e.getMessage());
Message.error("The uri '" + source + "' is in the wrong format.");
Message.error("Please use " + getRepositoryScheme()
- + "://user:pass@hostname/path/to/repository");
+ + "://user:pass@hostname/path/to/repository");
return null;
}
}
/**
- * Called, when user was not found in URL.
- * Maintain static hashe of credentials and retrieve or ask credentials
- * for host.
- *
- * @param host
- * host for which we want to get credentials.
- * @return credentials for given host
+ * Called, when user was not found in URL. Maintain static hashe of credentials and retrieve or
+ * ask credentials for host.
+ *
+ * @param host
+ * host for which we want to get credentials.
+ * @return credentials for given host
**/
private Credentials requestCredentials(String host) {
- Object o = credentialsCache.get(host);
- if (o == null) {
- Credentials c = CredentialsUtil.promptCredentials(
- new Credentials(null, host, user, userPassword), getPassFile());
- if (c != null) {
- if (credentialsCache.size() > MAX_CREDENTILAS_CACHE_SIZE) {
- credentialsCache.clear();
+ Object o = credentialsCache.get(host);
+ if (o == null) {
+ Credentials c = CredentialsUtil.promptCredentials(new Credentials(null, host, user,
+ userPassword), getPassFile());
+ if (c != null) {
+ if (credentialsCache.size() > MAX_CREDENTILAS_CACHE_SIZE) {
+ credentialsCache.clear();
+ }
+ credentialsCache.put(host, c);
}
- credentialsCache.put(host, c);
- }
- return c;
- } else {
- return (Credentials) o;
- }
+ return c;
+ } else {
+ return (Credentials) o;
+ }
}
/**
@@ -303,8 +301,7 @@ public abstract class AbstractSshBasedRe
}
/**
- * @return allowedAgentUse
- * Whether use of a local SSH agent for authentication is allowed
+ * @return allowedAgentUse Whether use of a local SSH agent for authentication is allowed
*/
public boolean isAllowedAgentUse() {
return allowedAgentUse;
Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/ssh/Scp.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/ssh/Scp.java?rev=1557968&r1=1557967&r2=1557968&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/ssh/Scp.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/ssh/Scp.java Tue Jan 14 08:27:37 2014
@@ -32,14 +32,14 @@ import com.jcraft.jsch.JSchException;
import com.jcraft.jsch.Session;
/**
- * This class is using the scp client to transfer data and information for the repository.
+ * This class is using the scp client to transfer data and information for the repository.
* <p>
- * It is based on the SCPClient from the ganymed ssh library from Christian Plattner,
- * released under a BSD style license.
+ * It is based on the SCPClient from the ganymed ssh library from Christian Plattner, released under
+ * a BSD style license.
* <p>
- * To minimize the dependency to the ssh library and because we needed some additional
- * functionality, we decided to copy'n'paste the single class rather than to inherit or
- * delegate it somehow.
+ * To minimize the dependency to the ssh library and because we needed some additional
+ * functionality, we decided to copy'n'paste the single class rather than to inherit or delegate it
+ * somehow.
* <p>
* Nevertheless credit should go to the original author.
*/
@@ -63,11 +63,11 @@ public class Scp {
private static final int BUFFER_SIZE = 64 * 1024;
/*
- * Maximum length authorized for scp lines.
- * This is a random limit - if your path names are longer, then adjust it.
+ * Maximum length authorized for scp lines. This is a random limit - if your path names are
+ * longer, then adjust it.
*/
private static final int MAX_SCP_LINE_LENGTH = 8192;
-
+
private Session session;
public class FileInfo {
@@ -188,8 +188,7 @@ public class Scp {
"Malformed C line sent by remote SCP binary, line too short.");
}
- if ((line.charAt(CLINE_SPACE_INDEX1) != ' ')
- || (line.charAt(CLINE_SPACE_INDEX2) == ' ')) {
+ if ((line.charAt(CLINE_SPACE_INDEX1) != ' ') || (line.charAt(CLINE_SPACE_INDEX2) == ' ')) {
throw new RemoteScpException("Malformed C line sent by remote SCP binary.");
}
@@ -206,8 +205,8 @@ public class Scp {
throw new RemoteScpException("Malformed C line sent by remote SCP binary.");
}
- if ((CLINE_SPACE_INDEX2 + 1 + lengthSubstring.length() + nameSubstring.length())
- != line.length()) {
+ if ((CLINE_SPACE_INDEX2 + 1 + lengthSubstring.length() + nameSubstring.length()) != line
+ .length()) {
throw new RemoteScpException("Malformed C line sent by remote SCP binary.");
}
@@ -280,10 +279,9 @@ public class Scp {
throws IOException, RemoteScpException {
byte[] buffer = new byte[BUFFER_SIZE];
- OutputStream os = new BufferedOutputStream(
- channel.getOutputStream(), SEND_FILE_BUFFER_LENGTH);
- InputStream is = new BufferedInputStream(
- channel.getInputStream(), SEND_BYTES_BUFFER_LENGTH);
+ OutputStream os = new BufferedOutputStream(channel.getOutputStream(),
+ SEND_FILE_BUFFER_LENGTH);
+ InputStream is = new BufferedInputStream(channel.getInputStream(), SEND_BYTES_BUFFER_LENGTH);
try {
if (channel.isConnected()) {
@@ -490,18 +488,18 @@ public class Scp {
if (mode.length() != MODE_LENGTH) {
throw new IllegalArgumentException("Invalid mode.");
}
-
+
for (int i = 0; i < mode.length(); i++) {
if (!Character.isDigit(mode.charAt(i))) {
throw new IllegalArgumentException("Invalid mode.");
}
}
}
-
+
String cmd = "scp -t ";
if (mode != null) {
cmd = cmd + "-p ";
- }
+ }
if (remoteTargetDir != null && remoteTargetDir.length() > 0) {
cmd = cmd + "-d " + remoteTargetDir;
}
Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/ssh/SshCache.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/ssh/SshCache.java?rev=1557968&r1=1557967&r2=1557968&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/ssh/SshCache.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/ssh/SshCache.java Tue Jan 14 08:27:37 2014
@@ -52,7 +52,7 @@ import com.jcraft.jsch.agentproxy.Remote
public final class SshCache {
private static final int SSH_DEFAULT_PORT = 22;
-
+
private SshCache() {
};
@@ -188,8 +188,8 @@ public final class SshCache {
if (port != -1 && port != SSH_DEFAULT_PORT) {
portToUse = Integer.toString(port);
}
- return user.toLowerCase(Locale.US).trim() + "@"
- + host.toLowerCase(Locale.US).trim() + ":" + portToUse;
+ return user.toLowerCase(Locale.US).trim() + "@" + host.toLowerCase(Locale.US).trim() + ":"
+ + portToUse;
}
/**
@@ -292,11 +292,10 @@ public final class SshCache {
/**
* Attempts to connect to a local SSH agent (using either UNIX sockets or PuTTY's Pageant)
- *
+ *
* @param jsch
- * Connection to be attached to an available local agent
- * @return
- * true if connected to agent, false otherwise
+ * Connection to be attached to an available local agent
+ * @return true if connected to agent, false otherwise
*/
private boolean attemptAgentUse(JSch jsch) {
try {
@@ -332,7 +331,7 @@ public final class SshCache {
*/
public Session getSession(String host, int port, String username, String userPassword,
File pemFile, String pemPassword, File passFile, boolean allowedAgentUse)
- throws IOException {
+ throws IOException {
Checks.checkNotNull(host, "host");
Checks.checkNotNull(username, "user");
Entry entry = getCacheEntry(username, host, port);
@@ -358,12 +357,12 @@ public final class SshCache {
session.setUserInfo(new CfUserInfo(host, username, userPassword, pemFile,
pemPassword, passFile));
session.setDaemonThread(true);
-
+
Properties config = new Properties();
config.setProperty("PreferredAuthentications",
- "publickey,keyboard-interactive,password");
+ "publickey,keyboard-interactive,password");
session.setConfig(config);
-
+
session.connect();
Message.verbose(":: SSH :: connected to " + host + "!");
setSession(username, host, port, session);
@@ -436,8 +435,9 @@ public final class SshCache {
public String getPassphrase() {
if (pemPassword == null && pemFile != null) {
- Credentials c = CredentialsUtil.promptCredentials(new Credentials(null, pemFile
- .getAbsolutePath(), userName, pemPassword), passfile);
+ Credentials c = CredentialsUtil.promptCredentials(
+ new Credentials(null, pemFile.getAbsolutePath(), userName, pemPassword),
+ passfile);
if (c != null) {
userName = c.getUserName();
pemPassword = c.getPasswd();
@@ -446,7 +446,7 @@ public final class SshCache {
return pemPassword;
}
- public String[] promptKeyboardInteractive(String destination, String name,
+ public String[] promptKeyboardInteractive(String destination, String name,
String instruction, String[] prompt, boolean[] echo) {
return new String[] {getPassword()};
}
Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/ssh/SshRepository.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/ssh/SshRepository.java?rev=1557968&r1=1557967&r2=1557968&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/ssh/SshRepository.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/ssh/SshRepository.java Tue Jan 14 08:27:37 2014
@@ -42,9 +42,9 @@ import com.jcraft.jsch.Session;
public class SshRepository extends AbstractSshBasedRepository {
private static final int BUFFER_SIZE = 64 * 1024;
-
+
private static final String ARGUMENT_PLACEHOLDER = "%arg";
-
+
private static final int POLL_SLEEP_TIME = 500;
private char fileSeparator = '/';
@@ -54,7 +54,7 @@ public class SshRepository extends Abstr
private String existCommand = "ls";
private String createDirCommand = "mkdir";
-
+
private String publishPermissions = null;
/**
@@ -69,7 +69,7 @@ public class SshRepository extends Abstr
* Fetch the needed file information for a given file (size, last modification time) and report
* it back in a SshResource
*
- * @param source
+ * @param source
* ssh uri for the file to get info for
* @return SshResource filled with the needed informations
* @see org.apache.ivy.plugins.repository.Repository#getResource(java.lang.String)
@@ -82,8 +82,8 @@ public class SshRepository extends Abstr
session = getSession(source);
Scp myCopy = new Scp(session);
Scp.FileInfo fileInfo = myCopy.getFileinfo(new URI(source).getPath());
- result = new SshResource(this, source, true, fileInfo.getLength(), fileInfo
- .getLastModified());
+ result = new SshResource(this, source, true, fileInfo.getLength(),
+ fileInfo.getLastModified());
} catch (IOException e) {
if (session != null) {
releaseSession(session, source);
@@ -430,10 +430,10 @@ public class SshRepository extends Abstr
public void setFileSeparator(char fileSeparator) {
this.fileSeparator = fileSeparator;
}
-
+
/**
- * A four digit string (e.g., 0644, see "man chmod", "man open") specifying the permissions
- * of the published files.
+ * A four digit string (e.g., 0644, see "man chmod", "man open") specifying the permissions of
+ * the published files.
*/
public void setPublishPermissions(String permissions) {
this.publishPermissions = permissions;
Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/url/URLRepository.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/url/URLRepository.java?rev=1557968&r1=1557967&r2=1557968&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/url/URLRepository.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/url/URLRepository.java Tue Jan 14 08:27:37 2014
@@ -49,7 +49,7 @@ public class URLRepository extends Abstr
}
return res;
}
-
+
public void get(String source, File destination) throws IOException {
fireTransferInitiated(getResource(source), TransferEvent.REQUEST_GET);
try {
@@ -120,7 +120,7 @@ public class URLRepository extends Abstr
ioe.initCause(e);
throw ioe;
}
-
+
File file = new File(path);
if (file.exists() && file.isDirectory()) {
String[] files = file.list();
Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/url/URLResource.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/url/URLResource.java?rev=1557968&r1=1557967&r2=1557968&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/url/URLResource.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/url/URLResource.java Tue Jan 14 08:27:37 2014
@@ -104,12 +104,13 @@ public class URLResource implements Loca
public File getFile() {
if (!isLocal()) {
- throw new IllegalStateException("Cannot get the local file for the not local resource " + url);
+ throw new IllegalStateException("Cannot get the local file for the not local resource "
+ + url);
}
try {
return new File(url.toURI());
} catch (URISyntaxException e) {
- return new File(url.getPath());
+ return new File(url.getPath());
}
}
}
Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/vfs/VfsResource.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/vfs/VfsResource.java?rev=1557968&r1=1557967&r2=1557968&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/vfs/VfsResource.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/vfs/VfsResource.java Tue Jan 14 08:27:37 2014
@@ -175,8 +175,7 @@ public class VfsResource implements Reso
/**
* Return a flag indicating whether a provided VFS resource physically exists
*
- * @return <code>true</code> if the resource physically exists, <code>false</code>
- * otherwise.
+ * @return <code>true</code> if the resource physically exists, <code>false</code> otherwise.
*/
public boolean physicallyExists() {
// TODO: there is no need for this method anymore, replace it by calling exists();
Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/vsftp/VsftpRepository.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/vsftp/VsftpRepository.java?rev=1557968&r1=1557967&r2=1557968&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/vsftp/VsftpRepository.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/vsftp/VsftpRepository.java Tue Jan 14 08:27:37 2014
@@ -77,7 +77,8 @@ public class VsftpRepository extends Abs
private static final int GET_JOIN_MAX_TIME = 100;
private static final int DEFAULT_REUSE_CONNECTION_TIME = 300000;
- // reuse connection during 5 minutes by default
+
+ // reuse connection during 5 minutes by default
private static final int DEFAULT_READ_TIMEOUT = 30000;
@@ -102,7 +103,7 @@ public class VsftpRepository extends Abs
private long readTimeout = DEFAULT_READ_TIMEOUT;
- private long reuseConnection = DEFAULT_REUSE_CONNECTION_TIME;
+ private long reuseConnection = DEFAULT_REUSE_CONNECTION_TIME;
private volatile long lastCommand;
@@ -152,8 +153,8 @@ public class VsftpRepository extends Abs
int index = source.lastIndexOf('/');
String srcName = index == -1 ? source : source.substring(index + 1);
- final File to = destDir == null
- ? Checks.checkAbsolute(srcName, "source") : new File(destDir, srcName);
+ final File to = destDir == null ? Checks.checkAbsolute(srcName, "source") : new File(
+ destDir, srcName);
final IOException[] ex = new IOException[1];
Thread get = new IvyThread() {
@@ -378,8 +379,7 @@ public class VsftpRepository extends Abs
boolean getPrompt = false;
// the reading is done in a for loop making five attempts to read the stream
// if we do not reach the next prompt
- for (int attempts = 0;
- !getPrompt && attempts < MAX_READ_PROMPT_ATTEMPT; attempts++) {
+ for (int attempts = 0; !getPrompt && attempts < MAX_READ_PROMPT_ATTEMPT; attempts++) {
while ((c = in.read()) != -1) {
attempts = 0; // we manage to read something, reset numer of
// attempts
@@ -407,8 +407,7 @@ public class VsftpRepository extends Abs
errorsLastUpdateTime = lastCommand;
}
- while ((System.currentTimeMillis() - errorsLastUpdateTime)
- < PROMPT_SLEEP_TIME) {
+ while ((System.currentTimeMillis() - errorsLastUpdateTime) < PROMPT_SLEEP_TIME) {
try {
Thread.sleep(ERROR_SLEEP_TIME);
} catch (InterruptedException e) {
@@ -443,7 +442,7 @@ public class VsftpRepository extends Abs
try {
wait(timeout);
} catch (InterruptedException e) {
- //nothing to do
+ // nothing to do
}
}
updateLastCommandTime();
@@ -503,7 +502,7 @@ public class VsftpRepository extends Abs
}
}
} catch (InterruptedException e) {
- //nothing to do
+ // nothing to do
}
disconnect();
}
@@ -552,7 +551,7 @@ public class VsftpRepository extends Abs
}
// CheckStyle:InnerAssignment ON
} catch (IOException e) {
- //nothing to do
+ // nothing to do
}
}
};
@@ -591,7 +590,7 @@ public class VsftpRepository extends Abs
try {
sendCommand("exit", false, DISCONNECT_COMMAND_TIMEOUT);
} catch (IOException e) {
- //nothing I can do
+ // nothing I can do
} finally {
closeConnection();
Message.verbose("disconnected of " + getHost());
@@ -609,22 +608,22 @@ public class VsftpRepository extends Abs
try {
process.destroy();
} catch (Exception ex) {
- //nothing I can do
+ // nothing I can do
}
try {
in.close();
} catch (Exception e) {
- //nothing I can do
+ // nothing I can do
}
try {
err.close();
} catch (Exception e) {
- //nothing I can do
+ // nothing I can do
}
try {
out.close();
} catch (Exception e) {
- //nothing I can do
+ // nothing I can do
}
connectionCleaner = null;
@@ -654,8 +653,8 @@ public class VsftpRepository extends Abs
} else {
try {
long contentLength = Long.parseLong(parts[LS_SIZE_INDEX]);
- String date = parts[LS_DATE_INDEX1] + " " + parts[LS_DATE_INDEX2]
- + " " + parts[LS_DATE_INDEX3] + " " + parts[LS_DATE_INDEX4];
+ String date = parts[LS_DATE_INDEX1] + " " + parts[LS_DATE_INDEX2] + " "
+ + parts[LS_DATE_INDEX3] + " " + parts[LS_DATE_INDEX4];
return new BasicResource(file, true, contentLength, FORMAT.parse(date)
.getTime(), false);
} catch (Exception ex) {
Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/AbstractPatternsBasedResolver.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/AbstractPatternsBasedResolver.java?rev=1557968&r1=1557967&r2=1557968&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/AbstractPatternsBasedResolver.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/AbstractPatternsBasedResolver.java Tue Jan 14 08:27:37 2014
@@ -63,8 +63,9 @@ public abstract class AbstractPatternsBa
if (isM2compatible()) {
mrid = convertM2IdForResourceSearch(mrid);
}
- return findResourceUsingPatterns(mrid, ivyPatterns, DefaultArtifact.newIvyArtifact(mrid,
- data.getDate()), getRMDParser(dd, data), data.getDate());
+ return findResourceUsingPatterns(mrid, ivyPatterns,
+ DefaultArtifact.newIvyArtifact(mrid, data.getDate()), getRMDParser(dd, data),
+ data.getDate());
}
public ResolvedResource findArtifactRef(Artifact artifact, Date date) {
@@ -75,7 +76,7 @@ public abstract class AbstractPatternsBa
return findResourceUsingPatterns(mrid, artifactPatterns, artifact,
getDefaultRMDParser(artifact.getModuleRevisionId().getModuleId()), date);
}
-
+
public ResolvedResource findResource(ResolvedResource[] rress, ResourceMDParser rmdparser,
ModuleRevisionId mrid, Date date) {
if (isM2compatible()) {
@@ -83,7 +84,7 @@ public abstract class AbstractPatternsBa
mrid = convertM2ResourceSearchIdToNormal(mrid);
}
return super.findResource(rress, rmdparser, mrid, date);
- }
+ }
protected ResolvedResource findResourceUsingPatterns(ModuleRevisionId moduleRevision,
List patternList, Artifact artifact, ResourceMDParser rmdparser, Date date) {
@@ -93,8 +94,8 @@ public abstract class AbstractPatternsBa
boolean stop = false;
for (Iterator iter = patternList.iterator(); iter.hasNext() && !stop;) {
String pattern = (String) iter.next();
- ResolvedResource rres = findResourceUsingPattern(
- moduleRevision, pattern, artifact, rmdparser, date);
+ ResolvedResource rres = findResourceUsingPattern(moduleRevision, pattern, artifact,
+ rmdparser, date);
if ((rres != null) && !foundRevisions.contains(rres.getRevision())) {
// only add the first found ResolvedResource for each revision
foundRevisions.add(rres.getRevision());
@@ -157,7 +158,7 @@ public abstract class AbstractPatternsBa
public Map[] listTokenValues(String[] tokens, Map criteria) {
Set result = new LinkedHashSet();
-
+
// use ivy patterns
List ivyPatterns = getIvyPatterns();
Map tokenValues = new HashMap(criteria);
@@ -170,7 +171,7 @@ public abstract class AbstractPatternsBa
String ivyPattern = (String) it.next();
result.addAll(resolveTokenValues(tokens, ivyPattern, tokenValues, false));
}
-
+
if (isAllownomd()) {
List artifactPatterns = getArtifactPatterns();
tokenValues = new HashMap(criteria);
@@ -184,18 +185,18 @@ public abstract class AbstractPatternsBa
result.addAll(resolveTokenValues(tokens, artifactPattern, tokenValues, true));
}
}
-
+
return (Map[]) result.toArray(new Map[result.size()]);
}
-
+
protected String getModuleDescriptorExtension() {
return "xml";
}
-
+
private Set resolveTokenValues(String[] tokens, String pattern, Map criteria, boolean noMd) {
Set result = new LinkedHashSet();
Set tokenSet = new HashSet(Arrays.asList(tokens));
-
+
Map tokenValues = new HashMap();
for (Iterator it = criteria.entrySet().iterator(); it.hasNext();) {
Map.Entry entry = (Entry) it.next();
@@ -205,13 +206,13 @@ public abstract class AbstractPatternsBa
tokenValues.put(key, value);
}
}
-
+
if (tokenSet.isEmpty()) {
// no more tokens to resolve
result.add(tokenValues);
return result;
}
-
+
String partiallyResolvedPattern = IvyPatternHelper.substituteTokens(pattern, tokenValues);
String token = IvyPatternHelper.getFirstToken(partiallyResolvedPattern);
if ((token == null) && exist(partiallyResolvedPattern)) {
@@ -219,7 +220,7 @@ public abstract class AbstractPatternsBa
result.add(tokenValues);
return result;
}
-
+
tokenSet.remove(token);
Matcher matcher = null;
@@ -235,13 +236,13 @@ public abstract class AbstractPatternsBa
List vals = new ArrayList(Arrays.asList(values));
filterNames(vals);
-
+
for (Iterator it = vals.iterator(); it.hasNext();) {
String value = (String) it.next();
if ((matcher != null) && !matcher.matches(value)) {
continue;
}
-
+
tokenValues.put(token, value);
String moreResolvedPattern = IvyPatternHelper.substituteTokens(
partiallyResolvedPattern, tokenValues);
@@ -254,19 +255,19 @@ public abstract class AbstractPatternsBa
newCriteria.put("artifact", value);
}
result.addAll(resolveTokenValues(
- (String[]) tokenSet.toArray(new String[tokenSet.size()]),
- moreResolvedPattern, newCriteria, noMd));
+ (String[]) tokenSet.toArray(new String[tokenSet.size()]), moreResolvedPattern,
+ newCriteria, noMd));
}
return result;
}
-
+
protected abstract String[] listTokenValues(String pattern, String token);
-
+
protected abstract boolean exist(String path);
protected void findTokenValues(Collection names, List patterns, Map tokenValues, String token) {
- //to be overridden by subclasses wanting to have listing features
+ // to be overridden by subclasses wanting to have listing features
}
/**
@@ -331,7 +332,7 @@ public abstract class AbstractPatternsBa
public void setM2compatible(boolean compatible) {
m2compatible = compatible;
}
-
+
protected ModuleRevisionId convertM2ResourceSearchIdToNormal(ModuleRevisionId mrid) {
if (mrid.getOrganisation() == null || mrid.getOrganisation().indexOf('/') == -1) {
return mrid;
@@ -345,8 +346,8 @@ public abstract class AbstractPatternsBa
if (mrid.getOrganisation() == null || mrid.getOrganisation().indexOf('.') == -1) {
return mrid;
}
- return ModuleRevisionId.newInstance(mrid.getOrganisation().replace('.', '/'),
- mrid.getName(), mrid.getBranch(), mrid.getRevision(),
+ return ModuleRevisionId.newInstance(mrid.getOrganisation().replace('.', '/'),
+ mrid.getName(), mrid.getBranch(), mrid.getRevision(),
mrid.getQualifiedExtraAttributes());
}
@@ -356,9 +357,9 @@ public abstract class AbstractPatternsBa
protected void convertM2TokenValuesForResourceSearch(Map tokenValues) {
if (tokenValues.get(IvyPatternHelper.ORGANISATION_KEY) instanceof String) {
- tokenValues.put(IvyPatternHelper.ORGANISATION_KEY,
- convertM2OrganizationForResourceSearch(
- (String) tokenValues.get(IvyPatternHelper.ORGANISATION_KEY)));
+ tokenValues.put(IvyPatternHelper.ORGANISATION_KEY,
+ convertM2OrganizationForResourceSearch((String) tokenValues
+ .get(IvyPatternHelper.ORGANISATION_KEY)));
}
}
Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/AbstractResolver.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/AbstractResolver.java?rev=1557968&r1=1557967&r2=1557968&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/AbstractResolver.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/AbstractResolver.java Tue Jan 14 08:27:37 2014
@@ -71,8 +71,8 @@ import org.apache.ivy.util.Message;
/**
* This abstract resolver only provides handling for resolver name
*/
-public abstract class AbstractResolver
- implements DependencyResolver, HasLatestStrategy, Validatable {
+public abstract class AbstractResolver implements DependencyResolver, HasLatestStrategy,
+ Validatable {
/**
* True if parsed ivy files should be validated against xsd, false if they should not, null if
@@ -83,7 +83,7 @@ public abstract class AbstractResolver
private String name;
private ResolverSettings settings;
-
+
private EventManager eventManager = null; // may remain null
/**
@@ -99,9 +99,9 @@ public abstract class AbstractResolver
private Namespace namespace;
private String namespaceName;
-
+
private String cacheManagerName;
-
+
private RepositoryCacheManager repositoryCacheManager;
// used to store default values for nested cache
@@ -114,7 +114,7 @@ public abstract class AbstractResolver
public ResolverSettings getSettings() {
return settings;
}
-
+
public ParserSettings getParserSettings() {
return new ResolverParserSettings();
}
@@ -177,7 +177,7 @@ public abstract class AbstractResolver
public Map[] listTokenValues(String[] tokens, Map criteria) {
return new Map[0];
}
-
+
public OrganisationEntry[] listOrganisations() {
return new OrganisationEntry[0];
}
@@ -202,7 +202,7 @@ public abstract class AbstractResolver
public String getTypeName() {
return getClass().getName();
}
-
+
/**
* Default implementation downloads the artifact without taking advantage of its location
*/
@@ -226,9 +226,8 @@ public abstract class AbstractResolver
* according to IVY-831, it seems that this actually happen sometime, while the contract
* of DependencyResolver says that it should never return null
*/
- throw new IllegalStateException(
- "null download report returned by " + getName() + " (" + getClass().getName() + ")"
- + " when trying to download " + artifact);
+ throw new IllegalStateException("null download report returned by " + getName() + " ("
+ + getClass().getName() + ")" + " when trying to download " + artifact);
}
ArtifactDownloadReport adr = dr.getArtifactReport(artifact);
return adr.getDownloadStatus() == DownloadStatus.FAILED ? null : adr.getArtifactOrigin();
@@ -246,17 +245,16 @@ public abstract class AbstractResolver
if (latestStrategyName != null && !"default".equals(latestStrategyName)) {
latestStrategy = getSettings().getLatestStrategy(latestStrategyName);
if (latestStrategy == null) {
- throw new IllegalStateException(
- "unknown latest strategy '" + latestStrategyName + "'");
+ throw new IllegalStateException("unknown latest strategy '"
+ + latestStrategyName + "'");
}
} else {
latestStrategy = getSettings().getDefaultLatestStrategy();
Message.debug(getName() + ": no latest strategy defined: using default");
}
} else {
- throw new IllegalStateException(
- "no ivy instance found: "
- + "impossible to get a latest strategy without ivy instance");
+ throw new IllegalStateException("no ivy instance found: "
+ + "impossible to get a latest strategy without ivy instance");
}
}
@@ -287,8 +285,7 @@ public abstract class AbstractResolver
if (namespaceName != null) {
namespace = getSettings().getNamespace(namespaceName);
if (namespace == null) {
- throw new IllegalStateException(
- "unknown namespace '" + namespaceName + "'");
+ throw new IllegalStateException("unknown namespace '" + namespaceName + "'");
}
} else {
namespace = getSettings().getSystemNamespace();
@@ -342,23 +339,21 @@ public abstract class AbstractResolver
return data.getNode(toSystem(resolvedMrid));
}
- protected ResolvedModuleRevision findModuleInCache(
- DependencyDescriptor dd, ResolveData data) {
+ protected ResolvedModuleRevision findModuleInCache(DependencyDescriptor dd, ResolveData data) {
return findModuleInCache(dd, data, false);
}
- protected ResolvedModuleRevision findModuleInCache(
- DependencyDescriptor dd, ResolveData data, boolean anyResolver) {
- ResolvedModuleRevision rmr = getRepositoryCacheManager().findModuleInCache(
- dd, dd.getDependencyRevisionId(),
- getCacheOptions(data), anyResolver ? null : getName());
+ protected ResolvedModuleRevision findModuleInCache(DependencyDescriptor dd, ResolveData data,
+ boolean anyResolver) {
+ ResolvedModuleRevision rmr = getRepositoryCacheManager().findModuleInCache(dd,
+ dd.getDependencyRevisionId(), getCacheOptions(data), anyResolver ? null : getName());
if (rmr == null) {
return null;
}
- if (data.getReport() != null
+ if (data.getReport() != null
&& data.isBlacklisted(data.getReport().getConfiguration(), rmr.getId())) {
- Message.verbose("\t" + getName() + ": found revision in cache: "
- + rmr.getId() + " for " + dd + ", but it is blacklisted");
+ Message.verbose("\t" + getName() + ": found revision in cache: " + rmr.getId()
+ + " for " + dd + ", but it is blacklisted");
return null;
}
return rmr;
@@ -367,7 +362,7 @@ public abstract class AbstractResolver
public void setChangingMatcher(String changingMatcherName) {
this.changingMatcherName = changingMatcherName;
}
-
+
protected String getChangingMatcherName() {
return changingMatcherName;
}
@@ -375,7 +370,7 @@ public abstract class AbstractResolver
public void setChangingPattern(String changingPattern) {
this.changingPattern = changingPattern;
}
-
+
protected String getChangingPattern() {
return changingPattern;
}
@@ -383,7 +378,7 @@ public abstract class AbstractResolver
public void setCheckmodified(boolean check) {
checkmodified = Boolean.valueOf(check);
}
-
+
public RepositoryCacheManager getRepositoryCacheManager() {
if (repositoryCacheManager == null) {
initRepositoryCacheManagerFromSettings();
@@ -396,36 +391,35 @@ public abstract class AbstractResolver
repositoryCacheManager = settings.getDefaultRepositoryCacheManager();
if (repositoryCacheManager == null) {
throw new IllegalStateException(
- "no default cache manager defined with current settings");
+ "no default cache manager defined with current settings");
}
} else {
repositoryCacheManager = settings.getRepositoryCacheManager(cacheManagerName);
if (repositoryCacheManager == null) {
- throw new IllegalStateException(
- "unknown cache manager '" + cacheManagerName
- + "'. Available caches are "
- + Arrays.asList(settings.getRepositoryCacheManagers()));
+ throw new IllegalStateException("unknown cache manager '" + cacheManagerName
+ + "'. Available caches are "
+ + Arrays.asList(settings.getRepositoryCacheManagers()));
}
}
}
-
+
public void setRepositoryCacheManager(RepositoryCacheManager repositoryCacheManager) {
this.cacheManagerName = repositoryCacheManager.getName();
this.repositoryCacheManager = repositoryCacheManager;
}
-
+
public void setCache(String cacheName) {
cacheManagerName = cacheName;
}
-
+
public void setEventManager(EventManager eventManager) {
this.eventManager = eventManager;
}
-
+
public EventManager getEventManager() {
return eventManager;
}
-
+
public void validate() {
initRepositoryCacheManagerFromSettings();
initNamespaceFromSettings();
@@ -434,14 +428,14 @@ public abstract class AbstractResolver
protected CacheMetadataOptions getCacheOptions(ResolveData data) {
return (CacheMetadataOptions) new CacheMetadataOptions()
- .setChangingMatcherName(getChangingMatcherName())
- .setChangingPattern(getChangingPattern())
- .setCheckTTL(!data.getOptions().isUseCacheOnly())
- .setCheckmodified(data.getOptions().isUseCacheOnly() ? Boolean.FALSE : checkmodified)
- .setValidate(doValidate(data))
- .setNamespace(getNamespace())
- .setForce(data.getOptions().isRefresh())
- .setListener(getDownloadListener(getDownloadOptions(data.getOptions())));
+ .setChangingMatcherName(getChangingMatcherName())
+ .setChangingPattern(getChangingPattern())
+ .setCheckTTL(!data.getOptions().isUseCacheOnly())
+ .setCheckmodified(
+ data.getOptions().isUseCacheOnly() ? Boolean.FALSE : checkmodified)
+ .setValidate(doValidate(data)).setNamespace(getNamespace())
+ .setForce(data.getOptions().isRefresh())
+ .setListener(getDownloadListener(getDownloadOptions(data.getOptions())));
}
protected CacheDownloadOptions getCacheDownloadOptions(DownloadOptions options) {
@@ -453,7 +447,7 @@ public abstract class AbstractResolver
protected DownloadOptions getDownloadOptions(ResolveOptions options) {
return (DownloadOptions) new DownloadOptions().setLog(options.getLog());
}
-
+
public void abortPublishTransaction() throws IOException {
/* Default implementation is a no-op */
}
@@ -462,8 +456,8 @@ public abstract class AbstractResolver
/* Default implementation is a no-op */
}
- public void beginPublishTransaction(
- ModuleRevisionId module, boolean overwrite) throws IOException {
+ public void beginPublishTransaction(ModuleRevisionId module, boolean overwrite)
+ throws IOException {
/* Default implementation is a no-op */
}
@@ -471,12 +465,12 @@ public abstract class AbstractResolver
return new DownloadListener() {
public void needArtifact(RepositoryCacheManager cache, Artifact artifact) {
if (eventManager != null) {
- eventManager.fireIvyEvent(
- new NeedArtifactEvent(AbstractResolver.this, artifact));
+ eventManager
+ .fireIvyEvent(new NeedArtifactEvent(AbstractResolver.this, artifact));
}
}
- public void startArtifactDownload(
- RepositoryCacheManager cache, ResolvedResource rres,
+
+ public void startArtifactDownload(RepositoryCacheManager cache, ResolvedResource rres,
Artifact artifact, ArtifactOrigin origin) {
if (artifact.isMetadata() || LogOptions.LOG_QUIET.equals(options.getLog())) {
Message.verbose("downloading " + rres.getResource() + " ...");
@@ -484,24 +478,21 @@ public abstract class AbstractResolver
Message.info("downloading " + rres.getResource() + " ...");
}
if (eventManager != null) {
- eventManager.fireIvyEvent(
- new StartArtifactDownloadEvent(
- AbstractResolver.this, artifact, origin));
- }
+ eventManager.fireIvyEvent(new StartArtifactDownloadEvent(AbstractResolver.this,
+ artifact, origin));
+ }
}
- public void endArtifactDownload(
- RepositoryCacheManager cache, Artifact artifact,
+
+ public void endArtifactDownload(RepositoryCacheManager cache, Artifact artifact,
ArtifactDownloadReport adr, File archiveFile) {
if (eventManager != null) {
- eventManager.fireIvyEvent(
- new EndArtifactDownloadEvent(
- AbstractResolver.this, artifact, adr, archiveFile));
+ eventManager.fireIvyEvent(new EndArtifactDownloadEvent(AbstractResolver.this,
+ artifact, adr, archiveFile));
}
}
};
}
-
/**
* Returns true if rmr1 is after rmr2, using the latest strategy to determine which is the
* latest
@@ -511,19 +502,16 @@ public abstract class AbstractResolver
* @return
*/
protected boolean isAfter(ResolvedModuleRevision rmr1, ResolvedModuleRevision rmr2, Date date) {
- ArtifactInfo[] ais = new ArtifactInfo[] {
- new ResolvedModuleRevisionArtifactInfo(rmr1),
+ ArtifactInfo[] ais = new ArtifactInfo[] {new ResolvedModuleRevisionArtifactInfo(rmr1),
new ResolvedModuleRevisionArtifactInfo(rmr2)};
return getLatestStrategy().findLatest(ais, date) == ais[0];
}
- protected ResolvedModuleRevision checkLatest(
- DependencyDescriptor dd,
- ResolvedModuleRevision newModuleFound,
- ResolveData data) {
+ protected ResolvedModuleRevision checkLatest(DependencyDescriptor dd,
+ ResolvedModuleRevision newModuleFound, ResolveData data) {
Checks.checkNotNull(dd, "dd");
Checks.checkNotNull(data, "data");
-
+
// check if latest is asked and compare to return the most recent
ResolvedModuleRevision previousModuleFound = data.getCurrentResolvedModuleRevision();
String newModuleDesc = describe(newModuleFound);
@@ -536,7 +524,7 @@ public abstract class AbstractResolver
Message.debug("\tmodule revision kept as younger: " + newModuleDesc);
saveModuleRevisionIfNeeded(dd, newModuleFound);
return newModuleFound;
- } else if (!newModuleFound.getDescriptor().isDefault()
+ } else if (!newModuleFound.getDescriptor().isDefault()
&& previousModuleFound.getDescriptor().isDefault()) {
Message.debug("\tmodule revision kept as better (not default): " + newModuleDesc);
saveModuleRevisionIfNeeded(dd, newModuleFound);
@@ -549,10 +537,10 @@ public abstract class AbstractResolver
protected void saveModuleRevisionIfNeeded(DependencyDescriptor dd,
ResolvedModuleRevision newModuleFound) {
- if (newModuleFound != null
+ if (newModuleFound != null
&& getSettings().getVersionMatcher().isDynamic(dd.getDependencyRevisionId())) {
- getRepositoryCacheManager().saveResolvedRevision(
- dd.getDependencyRevisionId(), newModuleFound.getId().getRevision());
+ getRepositoryCacheManager().saveResolvedRevision(dd.getDependencyRevisionId(),
+ newModuleFound.getId().getRevision());
}
}
@@ -560,9 +548,8 @@ public abstract class AbstractResolver
if (rmr == null) {
return "[none]";
}
- return rmr.getId()
- + (rmr.getDescriptor().isDefault() ? "[default]" : "") + " from "
- + rmr.getResolver().getName();
+ return rmr.getId() + (rmr.getDescriptor().isDefault() ? "[default]" : "") + " from "
+ + rmr.getResolver().getName();
}
private class ResolverParserSettings implements ParserSettings {
@@ -614,6 +601,6 @@ public abstract class AbstractResolver
public String substitute(String value) {
return AbstractResolver.this.getSettings().substitute(value);
}
-
+
}
}
Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/AbstractSshBasedResolver.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/AbstractSshBasedResolver.java?rev=1557968&r1=1557967&r2=1557968&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/AbstractSshBasedResolver.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/AbstractSshBasedResolver.java Tue Jan 14 08:27:37 2014
@@ -57,7 +57,7 @@ public abstract class AbstractSshBasedRe
/**
* Determines whether a local SSH agent may be used for authentication
- *
+ *
* @param allowedAgentUse
* true if an agent may be used if available
*/
Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/BasicResolver.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/BasicResolver.java?rev=1557968&r1=1557967&r2=1557968&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/BasicResolver.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/BasicResolver.java Tue Jan 14 08:27:37 2014
@@ -608,11 +608,9 @@ public abstract class BasicResolver exte
+ md.getModuleRevisionId().getBranch() + "'; ");
ok = false;
}
- if (ivyRef.getRevision() != null
- && !ivyRef.getRevision().startsWith("working@")
+ if (ivyRef.getRevision() != null && !ivyRef.getRevision().startsWith("working@")
&& !mrid.getRevision().equals(md.getModuleRevisionId().getRevision())) {
- ModuleRevisionId expectedMrid = ModuleRevisionId
- .newInstance(mrid, mrid.getRevision());
+ ModuleRevisionId expectedMrid = ModuleRevisionId.newInstance(mrid, mrid.getRevision());
if (!getSettings().getVersionMatcher().accept(expectedMrid, md)) {
Message.error("\t" + getName() + ": bad revision found in " + ivyRef.getResource()
+ ": expected='" + ivyRef.getRevision() + " found='"
Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/CacheResolver.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/CacheResolver.java?rev=1557968&r1=1557967&r2=1557968&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/CacheResolver.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/CacheResolver.java Tue Jan 14 08:27:37 2014
@@ -58,8 +58,8 @@ public class CacheResolver extends FileS
ModuleRevisionId mrid = dd.getDependencyRevisionId();
// check revision
- ResolvedModuleRevision rmr = getRepositoryCacheManager()
- .findModuleInCache(dd, mrid, getCacheOptions(data), null);
+ ResolvedModuleRevision rmr = getRepositoryCacheManager().findModuleInCache(dd, mrid,
+ getCacheOptions(data), null);
if (rmr != null) {
Message.verbose("\t" + getName() + ": revision in cache: " + mrid);
return rmr;
@@ -73,8 +73,8 @@ public class CacheResolver extends FileS
Message.verbose("\t" + getName() + ": found ivy file in cache for " + mrid);
Message.verbose("\t\t=> " + ivyRef);
- ModuleRevisionId resolvedMrid = ModuleRevisionId.newInstance(mrid, ivyRef
- .getRevision());
+ ModuleRevisionId resolvedMrid = ModuleRevisionId.newInstance(mrid,
+ ivyRef.getRevision());
IvyNode node = data.getNode(resolvedMrid);
if (node != null && node.getModuleRevision() != null) {
// this revision has already be resolved : return it
@@ -83,10 +83,9 @@ public class CacheResolver extends FileS
return node.getModuleRevision();
}
rmr = getRepositoryCacheManager().findModuleInCache(
- dd.clone(ModuleRevisionId.newInstance(
- dd.getDependencyRevisionId(), ivyRef.getRevision())),
- dd.getDependencyRevisionId(),
- getCacheOptions(data), null);
+ dd.clone(ModuleRevisionId.newInstance(dd.getDependencyRevisionId(),
+ ivyRef.getRevision())), dd.getDependencyRevisionId(),
+ getCacheOptions(data), null);
if (rmr != null) {
Message.verbose("\t" + getName() + ": revision in cache: " + resolvedMrid);
return rmr;
@@ -112,8 +111,8 @@ public class CacheResolver extends FileS
ResolvedResource artifactRef = getArtifactRef(artifacts[i], null);
if (artifactRef != null) {
Message.verbose("\t[NOT REQUIRED] " + artifacts[i]);
- ArtifactOrigin origin = new ArtifactOrigin(
- artifacts[i], true, artifactRef.getResource().getName());
+ ArtifactOrigin origin = new ArtifactOrigin(artifacts[i], true, artifactRef
+ .getResource().getName());
File archiveFile = ((FileResource) artifactRef.getResource()).getFile();
adr.setDownloadStatus(DownloadStatus.NO);
adr.setSize(archiveFile.length());
@@ -130,7 +129,7 @@ public class CacheResolver extends FileS
ensureConfigured();
return super.exists(artifact);
}
-
+
public ArtifactOrigin locate(Artifact artifact) {
ensureConfigured();
return super.locate(artifact);
@@ -169,12 +168,12 @@ public class CacheResolver extends FileS
if (caches[i] instanceof DefaultRepositoryCacheManager) {
DefaultRepositoryCacheManager c = (DefaultRepositoryCacheManager) caches[i];
addIvyPattern(c.getBasedir().getAbsolutePath() + "/" + c.getIvyPattern());
- addArtifactPattern(
- c.getBasedir().getAbsolutePath() + "/" + c.getArtifactPattern());
+ addArtifactPattern(c.getBasedir().getAbsolutePath() + "/"
+ + c.getArtifactPattern());
} else {
- Message.verbose(
- caches[i] + ": cache implementation is not a DefaultRepositoryCacheManager:"
- + " unable to configure cache resolver with it");
+ Message.verbose(caches[i]
+ + ": cache implementation is not a DefaultRepositoryCacheManager:"
+ + " unable to configure cache resolver with it");
}
}
}