You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-commits@lucene.apache.org by dn...@apache.org on 2007/02/05 23:49:43 UTC
svn commit: r503911 - in /lucene/java/trunk: CHANGES.txt
src/java/org/apache/lucene/store/Directory.java
src/java/org/apache/lucene/store/FSDirectory.java
src/java/org/apache/lucene/store/RAMDirectory.java
Author: dnaber
Date: Mon Feb 5 14:49:42 2007
New Revision: 503911
URL: http://svn.apache.org/viewvc?view=rev&rev=503911
Log:
LUCENE-795: deprecate Directory.renameFile()
Modified:
lucene/java/trunk/CHANGES.txt
lucene/java/trunk/src/java/org/apache/lucene/store/Directory.java
lucene/java/trunk/src/java/org/apache/lucene/store/FSDirectory.java
lucene/java/trunk/src/java/org/apache/lucene/store/RAMDirectory.java
Modified: lucene/java/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/java/trunk/CHANGES.txt?view=diff&rev=503911&r1=503910&r2=503911
==============================================================================
--- lucene/java/trunk/CHANGES.txt (original)
+++ lucene/java/trunk/CHANGES.txt Mon Feb 5 14:49:42 2007
@@ -204,6 +204,9 @@
remove an old lock. The default implementation is to ask the
lockFactory (if non null) to clear the lock. (Mike McCandless)
+19. LUCENE-795: Directory.renameFile() has been deprecated as it is
+ not used anymore inside Lucene. (Daniel Naber)
+
Bug fixes
1. Fixed the web application demo (built with "ant war-demo") which
Modified: lucene/java/trunk/src/java/org/apache/lucene/store/Directory.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/store/Directory.java?view=diff&rev=503911&r1=503910&r2=503911
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/store/Directory.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/store/Directory.java Mon Feb 5 14:49:42 2007
@@ -63,8 +63,10 @@
throws IOException;
/** Renames an existing file in the directory.
- If a file already exists with the new name, then it is replaced.
- This replacement should be atomic. */
+ * If a file already exists with the new name, then it is replaced.
+ * This replacement is not guaranteed to be atomic.
+ * @deprecated
+ */
public abstract void renameFile(String from, String to)
throws IOException;
Modified: lucene/java/trunk/src/java/org/apache/lucene/store/FSDirectory.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/store/FSDirectory.java?view=diff&rev=503911&r1=503910&r2=503911
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/store/FSDirectory.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/store/FSDirectory.java Mon Feb 5 14:49:42 2007
@@ -351,7 +351,10 @@
throw new IOException("Cannot delete " + file);
}
- /** Renames an existing file in the directory. */
+ /** Renames an existing file in the directory.
+ * Warning: This is not atomic.
+ * @deprecated
+ */
public synchronized void renameFile(String from, String to)
throws IOException {
File old = new File(directory, from);
Modified: lucene/java/trunk/src/java/org/apache/lucene/store/RAMDirectory.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/store/RAMDirectory.java?view=diff&rev=503911&r1=503910&r2=503911
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/store/RAMDirectory.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/store/RAMDirectory.java Mon Feb 5 14:49:42 2007
@@ -21,8 +21,6 @@
import java.io.FileNotFoundException;
import java.io.File;
import java.io.Serializable;
-import java.util.Collection;
-import java.util.Enumeration;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Set;
@@ -185,8 +183,9 @@
throw new FileNotFoundException(name);
}
- /** Removes an existing file in the directory.
- * @throws IOException if from does not exist
+ /** Renames an existing file in the directory.
+ * @throws FileNotFoundException if from does not exist
+ * @deprecated
*/
public synchronized final void renameFile(String from, String to) throws IOException {
RAMFile fromFile = (RAMFile)fileMap.get(from);