updated files to build successfully

git-svn-id: https://svn.apache.org/repos/asf/maven/repository-manager/trunk@354743 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Edwin L. Punzalan 2005-12-07 07:06:30 +00:00
parent 5d5425c40c
commit 079aeac314
2 changed files with 22 additions and 23 deletions

View File

@ -140,25 +140,25 @@ public class AbstractChecksumArtifactReporterTest
//Initialize variables for creating jar files //Initialize variables for creating jar files
FileOutputStream f = null; FileOutputStream f = null;
JarOutputStream out = null; JarOutputStream out = null;
String repoUrl = super.repository.getUrl(); String repoUrl = super.repository.getBasedir();
try try
{ {
String dirs = filename.replace( '-', '/' ); String dirs = filename.replace( '-', '/' );
String[] split1 = repoUrl.split( "file:/" ); //String[] split1 = repoUrl.split( "file:/" );
split1[1] = split1[1] + "/"; //split1[1] = split1[1] + "/";
//create the group level directory of the artifact //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() ) if ( dirFiles.mkdirs() )
{ {
// create a jar file // 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 ) ); out = new JarOutputStream( new BufferedOutputStream( f ) );
// jar sample.txt // jar sample.txt
String filename1 = split1[1] + relativePath + dirs + "/sample.txt"; String filename1 = repoUrl + relativePath + dirs + "/sample.txt";
boolean bool = createSampleFile( filename1 ); boolean bool = createSampleFile( filename1 );
BufferedReader in = new BufferedReader( new FileReader( filename1 ) ); BufferedReader in = new BufferedReader( new FileReader( filename1 ) );
@ -172,8 +172,8 @@ public class AbstractChecksumArtifactReporterTest
out.close(); out.close();
//Create md5 and sha-1 checksum files.. //Create md5 and sha-1 checksum files..
byte[] md5chk = createChecksum( split1[1] + relativePath + dirs + "/" + filename + "." + type, "MD5" ); byte[] md5chk = createChecksum( repoUrl + relativePath + dirs + "/" + filename + "." + type, "MD5" );
byte[] sha1chk = createChecksum( split1[1] + relativePath + dirs + "/" + filename + "." + type, "SHA-1" ); byte[] sha1chk = createChecksum( repoUrl + relativePath + dirs + "/" + filename + "." + type, "SHA-1" );
System.out.println( "----- CREATED MD5 checksum ::: " + byteArrayToHexStr( md5chk ) ); System.out.println( "----- CREATED MD5 checksum ::: " + byteArrayToHexStr( md5chk ) );
System.out.println( "----- CREATED SHA-1 checksum ::: " + byteArrayToHexStr( sha1chk ) ); System.out.println( "----- CREATED SHA-1 checksum ::: " + byteArrayToHexStr( sha1chk ) );
@ -181,7 +181,7 @@ public class AbstractChecksumArtifactReporterTest
if ( md5chk != null ) 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 ); OutputStream os = new FileOutputStream( file );
OutputStreamWriter osw = new OutputStreamWriter( os ); OutputStreamWriter osw = new OutputStreamWriter( os );
if ( !isValid ) if ( !isValid )
@ -193,7 +193,7 @@ public class AbstractChecksumArtifactReporterTest
if ( sha1chk != null ) 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 ); OutputStream os = new FileOutputStream( file );
OutputStreamWriter osw = new OutputStreamWriter( os ); OutputStreamWriter osw = new OutputStreamWriter( os );
if ( !isValid ) if ( !isValid )
@ -226,23 +226,22 @@ public class AbstractChecksumArtifactReporterTest
try try
{ {
//create checksum for the metadata file.. //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 ); System.out.println( "REPO URL :::: " + repoUrl );
String[] split1 = repoUrl.split( "file:/" ); // String[] split1 = repoUrl.split( "file:/" );
split1[1] = split1[1] + "/"; // split1[1] = split1[1] + "/";
// get the pre-created metadata file String url = repository.getBasedir() + "/" + filename + "." + type;
String[] split = split1[1].split( "/repository" );
String url = split[0] + "/" + filename + "." + type;
//System.out.println( "URL of maven-metadata file :: " + url );
boolean copied = copyFile( url, split1[1] + relativePath + 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 ); //System.out.println( "META FILE COPIED ---->>> " + copied );
//Create md5 and sha-1 checksum files.. //Create md5 and sha-1 checksum files..
byte[] md5chk = createChecksum( split1[1] + relativePath + filename + "." + type, "MD5" ); byte[] md5chk = createChecksum( repoUrl + relativePath + filename + "." + type, "MD5" );
byte[] sha1chk = createChecksum( split1[1] + relativePath + filename + "." + type, "SHA-1" ); byte[] sha1chk = createChecksum( repoUrl + relativePath + filename + "." + type, "SHA-1" );
System.out.println( "----- CREATED MD5 checksum ::: " + byteArrayToHexStr( md5chk ) ); System.out.println( "----- CREATED MD5 checksum ::: " + byteArrayToHexStr( md5chk ) );
System.out.println( "----- CREATED SHA-1 checksum ::: " + byteArrayToHexStr( sha1chk ) ); System.out.println( "----- CREATED SHA-1 checksum ::: " + byteArrayToHexStr( sha1chk ) );
@ -250,7 +249,7 @@ public class AbstractChecksumArtifactReporterTest
if ( md5chk != null ) 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 ); OutputStream os = new FileOutputStream( file );
OutputStreamWriter osw = new OutputStreamWriter( os ); OutputStreamWriter osw = new OutputStreamWriter( os );
if ( !isValid ) if ( !isValid )
@ -262,7 +261,7 @@ public class AbstractChecksumArtifactReporterTest
if ( sha1chk != null ) 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 ); OutputStream os = new FileOutputStream( file );
OutputStreamWriter osw = new OutputStreamWriter( os ); OutputStreamWriter osw = new OutputStreamWriter( os );
if ( !isValid ) if ( !isValid )