maven-wagon-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mic...@apache.org
Subject cvs commit: maven-wagon/wagon-api/src/main/java/org/apache/maven/wagon/providers/file FileWagon.java
Date Wed, 09 Jun 2004 19:36:10 GMT
michal      2004/06/09 12:36:10

  Modified:    wagon-api/src/main/java/org/apache/maven/wagon/providers/file
                        FileWagon.java
  Log:
  more specific exception is thrown
  
  Revision  Changes    Path
  1.6       +9 -3      maven-wagon/wagon-api/src/main/java/org/apache/maven/wagon/providers/file/FileWagon.java
  
  Index: FileWagon.java
  ===================================================================
  RCS file: /home/cvs/maven-wagon/wagon-api/src/main/java/org/apache/maven/wagon/providers/file/FileWagon.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- FileWagon.java	3 Jun 2004 18:26:59 -0000	1.5
  +++ FileWagon.java	9 Jun 2004 19:36:10 -0000	1.6
  @@ -20,6 +20,7 @@
   import org.apache.maven.wagon.LazyFileOutputStream;
   import org.apache.maven.wagon.StreamWagon;
   import org.apache.maven.wagon.TransferFailedException;
  +import org.apache.maven.wagon.ResourceDoesNotExistException;
   
   import java.io.File;
   import java.io.FileInputStream;
  @@ -39,11 +40,16 @@
    
       // get
       public InputStream getInputStream( String resource )
  -        throws TransferFailedException
  +            throws TransferFailedException, ResourceDoesNotExistException
       {
   
           File f = new File( getRepository().getBasedir(), resource );
  -        
  +
  +        if ( !f.exists() )
  +        {
  +            throw new ResourceDoesNotExistException( "File: "  + f + " does not exists"
);            
  +        }
  +
           try
           {
               return new FileInputStream( f );
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: wagon-cvs-unsubscribe@maven.apache.org
For additional commands, e-mail: wagon-cvs-help@maven.apache.org


Mime
View raw message