maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From epunza...@apache.org
Subject svn commit: r354743 - in /maven/repository-manager/trunk/maven-repository-reports-standard/src/test: java/org/apache/maven/repository/reporting/AbstractChecksumArtifactReporterTest.java maven-metadata.xml repository/maven-metadata.xml
Date Wed, 07 Dec 2005 07:06:39 GMT
Author: epunzalan
Date: Tue Dec  6 23:06:30 2005
New Revision: 354743

URL: http://svn.apache.org/viewcvs?rev=354743&view=rev
Log:
updated files to build successfully

Added:
    maven/repository-manager/trunk/maven-repository-reports-standard/src/test/repository/maven-metadata.xml
  (with props)
Removed:
    maven/repository-manager/trunk/maven-repository-reports-standard/src/test/maven-metadata.xml
Modified:
    maven/repository-manager/trunk/maven-repository-reports-standard/src/test/java/org/apache/maven/repository/reporting/AbstractChecksumArtifactReporterTest.java

Modified: maven/repository-manager/trunk/maven-repository-reports-standard/src/test/java/org/apache/maven/repository/reporting/AbstractChecksumArtifactReporterTest.java
URL: http://svn.apache.org/viewcvs/maven/repository-manager/trunk/maven-repository-reports-standard/src/test/java/org/apache/maven/repository/reporting/AbstractChecksumArtifactReporterTest.java?rev=354743&r1=354742&r2=354743&view=diff
==============================================================================
--- maven/repository-manager/trunk/maven-repository-reports-standard/src/test/java/org/apache/maven/repository/reporting/AbstractChecksumArtifactReporterTest.java
(original)
+++ maven/repository-manager/trunk/maven-repository-reports-standard/src/test/java/org/apache/maven/repository/reporting/AbstractChecksumArtifactReporterTest.java
Tue Dec  6 23:06:30 2005
@@ -140,25 +140,25 @@
         //Initialize variables for creating jar files
         FileOutputStream f = null;
         JarOutputStream out = null;
-        String repoUrl = super.repository.getUrl();
+        String repoUrl = super.repository.getBasedir();
         try
         {
             String dirs = filename.replace( '-', '/' );
-            String[] split1 = repoUrl.split( "file:/" );
-            split1[1] = split1[1] + "/";
+            //String[] split1 = repoUrl.split( "file:/" );
+            //split1[1] = split1[1] + "/";
 
             //create the group level directory of the artifact    
-            File dirFiles = new File( split1[1] + relativePath + dirs );
+            File dirFiles = new File( repoUrl + relativePath + dirs );
 
             if ( dirFiles.mkdirs() )
             {
 
                 // create a jar file
-                f = new FileOutputStream( split1[1] + relativePath + dirs + "/" + filename
+ "." + type );
+                f = new FileOutputStream( repoUrl + relativePath + dirs + "/" + filename
+ "." + type );
                 out = new JarOutputStream( new BufferedOutputStream( f ) );
 
                 // jar sample.txt
-                String filename1 = split1[1] + relativePath + dirs + "/sample.txt";
+                String filename1 = repoUrl + relativePath + dirs + "/sample.txt";
                 boolean bool = createSampleFile( filename1 );
 
                 BufferedReader in = new BufferedReader( new FileReader( filename1 ) );
@@ -172,8 +172,8 @@
                 out.close();
 
                 //Create md5 and sha-1 checksum files..
-                byte[] md5chk = createChecksum( split1[1] + relativePath + dirs + "/" + filename
+ "." + type, "MD5" );
-                byte[] sha1chk = createChecksum( split1[1] + relativePath + dirs + "/" +
filename + "." + type, "SHA-1" );
+                byte[] md5chk = createChecksum( repoUrl + relativePath + dirs + "/" + filename
+ "." + type, "MD5" );
+                byte[] sha1chk = createChecksum( repoUrl + relativePath + dirs + "/" + filename
+ "." + type, "SHA-1" );
                 System.out.println( "----- CREATED MD5 checksum ::: " + byteArrayToHexStr(
md5chk ) );
                 System.out.println( "----- CREATED SHA-1 checksum ::: " + byteArrayToHexStr(
sha1chk ) );
 
@@ -181,7 +181,7 @@
 
                 if ( md5chk != null )
                 {
-                    file = new File( split1[1] + relativePath + dirs + "/" + filename + "."
+ type + ".md5" );
+                    file = new File( repoUrl + relativePath + dirs + "/" + filename + "."
+ type + ".md5" );
                     OutputStream os = new FileOutputStream( file );
                     OutputStreamWriter osw = new OutputStreamWriter( os );
                     if ( !isValid )
@@ -193,7 +193,7 @@
 
                 if ( sha1chk != null )
                 {
-                    file = new File( split1[1] + relativePath + dirs + "/" + filename + "."
+ type + ".sha1" );
+                    file = new File( repoUrl + relativePath + dirs + "/" + filename + "."
+ type + ".sha1" );
                     OutputStream os = new FileOutputStream( file );
                     OutputStreamWriter osw = new OutputStreamWriter( os );
                     if ( !isValid )
@@ -226,23 +226,22 @@
         try
         {
             //create checksum for the metadata file..
-            String repoUrl = super.repository.getUrl();
+            String repoUrl = repository.getBasedir();
+            //System.out.println("repoUrl ---->>> " + repoUrl);
 
-            //System.out.println( "REPO URL :::: " + repoUrl );
-            String[] split1 = repoUrl.split( "file:/" );
-            split1[1] = split1[1] + "/";
-
-            // get the pre-created metadata file
-            String[] split = split1[1].split( "/repository" );
-            String url = split[0] + "/" + filename + "." + type;
-            //System.out.println( "URL of maven-metadata file :: " + url );
+            System.out.println( "REPO URL :::: " + repoUrl );
+           // String[] split1 = repoUrl.split( "file:/" );
+           // split1[1] = split1[1] + "/";
 
-            boolean copied = copyFile( url, split1[1] + relativePath + filename + "." + type
);
+            String url = repository.getBasedir() + "/" + filename + "." + type;
+
+            boolean copied = copyFile( url, repoUrl + relativePath + filename + "." + type
);
+            //FileUtils.copyFile( new File( url ), new File( repoUrl + relativePath + filename
+ "." + type ) );
             //System.out.println( "META FILE COPIED ---->>> " + copied );
 
             //Create md5 and sha-1 checksum files..
-            byte[] md5chk = createChecksum( split1[1] + relativePath + filename + "." + type,
"MD5" );
-            byte[] sha1chk = createChecksum( split1[1] + relativePath + filename + "." +
type, "SHA-1" );
+            byte[] md5chk = createChecksum( repoUrl + relativePath + filename + "." + type,
"MD5" );
+            byte[] sha1chk = createChecksum( repoUrl + relativePath + filename + "." + type,
"SHA-1" );
             System.out.println( "----- CREATED MD5 checksum ::: " + byteArrayToHexStr( md5chk
) );
             System.out.println( "----- CREATED SHA-1 checksum ::: " + byteArrayToHexStr(
sha1chk ) );
 
@@ -250,7 +249,7 @@
 
             if ( md5chk != null )
             {
-                file = new File( split1[1] + relativePath + filename + "." + type + ".md5"
);
+                file = new File( repoUrl + relativePath + filename + "." + type + ".md5"
);
                 OutputStream os = new FileOutputStream( file );
                 OutputStreamWriter osw = new OutputStreamWriter( os );
                 if ( !isValid )
@@ -262,7 +261,7 @@
 
             if ( sha1chk != null )
             {
-                file = new File( split1[1] + relativePath + filename + "." + type + ".sha1"
);
+                file = new File( repoUrl + relativePath + filename + "." + type + ".sha1"
);
                 OutputStream os = new FileOutputStream( file );
                 OutputStreamWriter osw = new OutputStreamWriter( os );
                 if ( !isValid )

Added: maven/repository-manager/trunk/maven-repository-reports-standard/src/test/repository/maven-metadata.xml
URL: http://svn.apache.org/viewcvs/maven/repository-manager/trunk/maven-repository-reports-standard/src/test/repository/maven-metadata.xml?rev=354743&view=auto
==============================================================================
--- maven/repository-manager/trunk/maven-repository-reports-standard/src/test/repository/maven-metadata.xml
(added)
+++ maven/repository-manager/trunk/maven-repository-reports-standard/src/test/repository/maven-metadata.xml
Tue Dec  6 23:06:30 2005
@@ -0,0 +1,5 @@
+<metadata>
+<groupId>checksumTest</groupId>
+<artifactId>invalidArtifact</artifactId>
+<version>1.0</version>
+</metadata>

Propchange: maven/repository-manager/trunk/maven-repository-reports-standard/src/test/repository/maven-metadata.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/repository-manager/trunk/maven-repository-reports-standard/src/test/repository/maven-metadata.xml
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"



Mime
View raw message