You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ace.apache.org by ma...@apache.org on 2012/08/04 15:40:13 UTC

svn commit: r1369322 - /ace/sandbox/marrs/org.apache.ace.client.repository.helper.base/src/org/apache/ace/client/repository/helper/base/VelocityArtifactPreprocessor.java

Author: marrs
Date: Sat Aug  4 13:40:13 2012
New Revision: 1369322

URL: http://svn.apache.org/viewvc?rev=1369322&view=rev
Log:
Simplified a few internal methods.

Modified:
    ace/sandbox/marrs/org.apache.ace.client.repository.helper.base/src/org/apache/ace/client/repository/helper/base/VelocityArtifactPreprocessor.java

Modified: ace/sandbox/marrs/org.apache.ace.client.repository.helper.base/src/org/apache/ace/client/repository/helper/base/VelocityArtifactPreprocessor.java
URL: http://svn.apache.org/viewvc/ace/sandbox/marrs/org.apache.ace.client.repository.helper.base/src/org/apache/ace/client/repository/helper/base/VelocityArtifactPreprocessor.java?rev=1369322&r1=1369321&r2=1369322&view=diff
==============================================================================
--- ace/sandbox/marrs/org.apache.ace.client.repository.helper.base/src/org/apache/ace/client/repository/helper/base/VelocityArtifactPreprocessor.java (original)
+++ ace/sandbox/marrs/org.apache.ace.client.repository.helper.base/src/org/apache/ace/client/repository/helper/base/VelocityArtifactPreprocessor.java Sat Aug  4 13:40:13 2012
@@ -161,10 +161,13 @@ public class VelocityArtifactPreprocesso
      * @param targetID
      * @param version
      * @return
-     * @throws MalformedURLException
      */
-    private String getFilename(String url, String targetID, String version) throws MalformedURLException {
-        return urlToFile(new URL(url)).getName() + "-" + targetID + "-" + version;
+    private String getFilename(String url, String targetID, String version) {
+        int indexOfLastSlash = url.lastIndexOf('/');
+        if (indexOfLastSlash != -1) {
+            url = url.substring(indexOfLastSlash + 1);
+        }
+        return url + "-" + targetID + "-" + version;
     }
 
     /**
@@ -172,9 +175,8 @@ public class VelocityArtifactPreprocesso
      * @param targetID
      * @param version
      * @return
-     * @throws MalformedURLException
      */
-    private String getFullUrl(String url, String targetID, String version) throws MalformedURLException {
+    private String getFullUrl(String url, String targetID, String version) {
         return url + "-" + targetID + "-" + version;
     }