Changeset 15884


Ignore:
Timestamp:
2008-06-05T15:19:08+12:00 (16 years ago)
Author:
oranfry
Message:

now you can specify an output directory for the resource chunks to be put

Location:
release-kits/shared/ant-tasks/orans
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • release-kits/shared/ant-tasks/orans/SplitResource.java

    r15878 r15884  
    1313    private File resource = null;
    1414    private File resourceScript = null;
     15    private File outputDir = null;
    1516    private String resourceName = null;
    1617    private String resourceType = null;
     
    2223     */
    2324    public static void main( String[] args ) {
     25
    2426        SplitResource sr = new SplitResource();
    25 
    2627        sr.setResource( new File(args[0]) );
    27         sr.setResourceScript( new File(args[1]) );
    28         sr.setResourceName( args[2] );
    29         sr.setResourceType( args[3] );
    30         sr.setChunkSize( Integer.parseInt(args[4]) );
    31 
     28        sr.setOutputDir( new File(args[1]) );
     29        sr.setResourceScript( new File(args[2]) );
     30        sr.setResourceName( args[3] );
     31        sr.setResourceType( args[4] );
     32        sr.setChunkSize( Integer.parseInt(args[5]) );
    3233        sr.execute();
    3334
     
    3940            throw new BuildException( "Error - No resource specified !!" );
    4041        }
     42
     43        if ( outputDir == null ) {
     44            outputDir = new File(".");
     45        }
     46        outputDir.mkdir();
    4147
    4248        if ( chunkSize == 0 ) {
     
    6470            //open a file for output
    6571            DataOutputStream os;
    66             File partFile = new File( resource.getName() + "." + i );
     72            File partFile = new File( outputDir, resource.getName() + "." + i );
     73            System.out.println( "partFile: " + partFile );
     74
    6775            try {
    6876                os = new DataOutputStream( new FileOutputStream( partFile ) );
     
    159167    }
    160168
     169    public void setOutputDir(File outputDir) {
     170        this.outputDir = outputDir;
     171    }
    161172
    162173    public void setChunkSize(int chunkSize) {
Note: See TracChangeset for help on using the changeset viewer.