mirror of https://github.com/apache/lucene.git
LUCENE-795: deprecate Directory.renameFile()
git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@503911 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
0149b5f82f
commit
55450e5b2c
|
@ -204,6 +204,9 @@ API Changes
|
|||
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
|
||||
|
|
|
@ -63,8 +63,10 @@ public abstract class Directory {
|
|||
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;
|
||||
|
||||
|
|
|
@ -351,7 +351,10 @@ public class FSDirectory extends Directory {
|
|||
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);
|
||||
|
|
|
@ -21,8 +21,6 @@ import java.io.IOException;
|
|||
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 @@ public class RAMDirectory extends Directory implements Serializable {
|
|||
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);
|
||||
|
|
Loading…
Reference in New Issue