ace-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1369322 - /ace/sandbox/marrs/org.apache.ace.client.repository.helper.base/src/org/apache/ace/client/repository/helper/base/VelocityArtifactPreprocessor.java
Date Sat, 04 Aug 2012 13:40:13 GMT
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;
     }
 



Mime
View raw message