db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject svn commit: r240088 - in /db/derby/code/trunk/java/engine/org/apache/derby: iapi/store/access/FileResource.java impl/store/raw/data/RFResource.java
Date Thu, 25 Aug 2005 15:10:53 GMT
Author: djd
Date: Thu Aug 25 08:10:50 2005
New Revision: 240088

URL: http://svn.apache.org/viewcvs?rev=240088&view=rev
Log:
Cleanup some unused code in FileResource and its implementation.

Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/store/access/FileResource.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/RFResource.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/store/access/FileResource.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/engine/org/apache/derby/iapi/store/access/FileResource.java?rev=240088&r1=240087&r2=240088&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/store/access/FileResource.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/store/access/FileResource.java Thu
Aug 25 08:10:50 2005
@@ -121,20 +121,6 @@
 	public StorageFile getAsFile(String name, long generationId);
 
 	/**
-	  Get the File handle to a file resource. In some situations
-	  higher level code can make optimisations if it can access
-	  a file as a File, rather than an output stream. If this call
-	  returns null then the resouce is not accessable as a file
-	  (e.g. the database is in a zip file).
-	  
-	  @param name The name of the fileResource
-	  
-	  @return A File object representing the file, or null if
-	  the resource is not accessable as a file.
-	  */
-	public StorageFile getAsFile(String name);
-
-	/**
 	  Get the file resource as a stream.
 
 	  @exception IOException some io error occured
@@ -142,22 +128,6 @@
 	*/
 	public InputStream getAsStream(String name, long generationId)
 		throws IOException;
-
-	/**
-	  Get the file resource as a stream.
-
-	  @exception IOException some io error occured
-	  @exception FileNotFoundException file does not exist.
-	*/
-	public InputStream getAsStream(String name)
-		throws IOException;
-	/**
-	  Purge old generations that were removed or replaced
-	  before the database instant provided.
-	  @exception StandardException Ooops
-	  */
-    public void purgeOldGenerations(DatabaseInstant purgeTo)
-		throws StandardException;
 
     /**
      * @return the separator character to be used in file names.

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/RFResource.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/RFResource.java?rev=240088&r1=240087&r2=240088&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/RFResource.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/RFResource.java Thu
Aug 25 08:10:50 2005
@@ -42,7 +42,7 @@
 import java.io.FileNotFoundException;
 import java.io.IOException;
 
-public class RFResource implements FileResource {
+class RFResource implements FileResource {
 
 	protected final BaseDataFileFactory factory;
 
@@ -142,11 +142,11 @@
             factory.getRawStoreFactory().findUserTransaction(
                 cm, AccessFactoryGlobals.USER_TRANS_NAME);
 
-		tran.logAndDo(privRemoveFileOperation(name, currentGenerationId, purgeOnCommit));
+		tran.logAndDo(new RemoveFileOperation(name, currentGenerationId, purgeOnCommit));
 
 		if (purgeOnCommit) {
 
-			Serviceable s = privRemoveFile(getAsFile(name, currentGenerationId));
+			Serviceable s = new RemoveFile(getAsFile(name, currentGenerationId));
 
 			tran.addPostCommitWork(s);
 		}
@@ -183,7 +183,7 @@
 	/**
 	  @see FileResource#getAsFile
 	  */
-	public StorageFile getAsFile(String name)
+	private StorageFile getAsFile(String name)
 	{
 		return factory.storageFactory.newStorageFile( name);
 	}
@@ -198,44 +198,9 @@
         return getAsFile(name, generationId).getInputStream();
 	}
 
-	/**
-	  @see FileResource#getAsStream
-	  @exception IOException trouble accessing file.
-	  */
-	public InputStream getAsStream(String name)
-		 throws IOException
-	{
-		return getAsFile(name).getInputStream();
-	}
-
-	/**
-	  @see FileResource#purgeOldGenerations
-	  */
-    public void purgeOldGenerations(DatabaseInstant purgeTo)
-	{
-
-		// search from the start of the log until now
-		// remove any generation files that have been
-		// logged for removal and their transaction committed.
-
-		if (SanityManager.DEBUG)
-			SanityManager.THROWASSERT("purgeOldGenerations is not implemented");
-	}
-
     public char getSeparatorChar()
     {
         return factory.storageFactory.getSeparator();
-    }
-    
-    protected Serviceable privRemoveFile(StorageFile file)
-    {
-        return new RemoveFile(file);
-    }
-
-    protected RemoveFileOperation privRemoveFileOperation(
-        String name, long generationId, boolean removeAtOnce)
-    {
-        return new RemoveFileOperation(name,generationId,removeAtOnce);
     }
 } // end of class RFResource
 



Mime
View raw message