portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wea...@apache.org
Subject cvs commit: jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/deployment/fs FileObjectHandler.java JARObjectHandlerImpl.java FSObjectHandler.java
Date Mon, 19 Jan 2004 21:55:52 GMT
weaver      2004/01/19 13:55:52

  Modified:    portal/src/java/org/apache/jetspeed/deployment/fs
                        FileObjectHandler.java JARObjectHandlerImpl.java
                        FSObjectHandler.java
  Log:
  - added getFile() method
  - added checks for the existence of a file before attempting to create a JAR object
  
  Revision  Changes    Path
  1.3       +9 -1      jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/deployment/fs/FileObjectHandler.java
  
  Index: FileObjectHandler.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/deployment/fs/FileObjectHandler.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- FileObjectHandler.java	15 Jan 2004 16:10:52 -0000	1.2
  +++ FileObjectHandler.java	19 Jan 2004 21:55:52 -0000	1.3
  @@ -97,4 +97,12 @@
           return null;
       }
   
  +    /**
  +     * @return
  +     */
  +    public File getFile()
  +    {
  +        return file;
  +    }
  +
   }
  
  
  
  1.3       +21 -4     jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/deployment/fs/JARObjectHandlerImpl.java
  
  Index: JARObjectHandlerImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/deployment/fs/JARObjectHandlerImpl.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- JARObjectHandlerImpl.java	15 Jan 2004 16:10:52 -0000	1.2
  +++ JARObjectHandlerImpl.java	19 Jan 2004 21:55:52 -0000	1.3
  @@ -63,8 +63,6 @@
   import java.util.jar.JarFile;
   import java.util.jar.JarInputStream;
   
  -import org.apache.commons.configuration.Configuration;
  -import org.apache.commons.configuration.PropertiesConfiguration;
   import org.apache.commons.logging.Log;
   import org.apache.commons.logging.LogFactory;
   
  @@ -108,8 +106,19 @@
       public void setFile(File file) throws IOException
       {        
           jar = file;
  -		jarFile = new JarFile(jar);
  +        
  +        // On undeployment, the archive will not exist
  +        if(jar.exists())
  +        {
  +			jarFile = new JarFile(jar);
  +        }
  +		
       }
  +    
  +	public File getFile()
  +	{        
  +		return jar;
  +	}
   
       /**
        * @see org.apache.jetspeed.deployment.fs.FSObjectHandler#getAsStream()
  @@ -136,9 +145,17 @@
        */
       public void close() throws IOException
       {
  +    	// prevent resource leaking
  +    	if(jarFile != null)
  +    	{
  +			jarFile.close();
  +    	}    	
  +    	jar=null;
  +    	jarFile=null;
           if(content != null)
           {
           	content.close();
  +        	content = null;
           }
   
       }
  
  
  
  1.2       +3 -1      jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/deployment/fs/FSObjectHandler.java
  
  Index: FSObjectHandler.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/deployment/fs/FSObjectHandler.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- FSObjectHandler.java	14 Jan 2004 19:32:57 -0000	1.1
  +++ FSObjectHandler.java	19 Jan 2004 21:55:52 -0000	1.2
  @@ -29,5 +29,7 @@
   	
   	void setFile(File file) throws IOException;
   	
  +	File getFile();
  +	
   
   }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-dev-help@jakarta.apache.org


Mime
View raw message