cn.dreampie.common.util.stream
类 DefaultFileRenamer
java.lang.Object
cn.dreampie.common.util.stream.FileRenamer
cn.dreampie.common.util.stream.DefaultFileRenamer
public class DefaultFileRenamer
- extends FileRenamer
Implements a renaming policy that adds increasing integers to the body of
any file that collides. For example, if foo.gif is being uploaded and a
file by the same name already exists, this logic will rename the upload
foo1.gif. A second upload by the same name would be foo2.gif.
Note that for safety the rename() method creates a zero-length file with
the chosen name to act as a marker that the name is taken even before the
upload starts writing the bytes.
- 版本:
- 1.0, 2002/04/30, initial revision, thanks to Yoonjung Lee
for this idea
- 作者:
- Jason Hunter
|
方法摘要 |
File |
rename(File f)
Returns a File object holding a new name for the specified file. |
| 从类 java.lang.Object 继承的方法 |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DefaultFileRenamer
public DefaultFileRenamer()
rename
public File rename(File f)
- 从类
FileRenamer 复制的描述
- Returns a File object holding a new name for the specified file.
- 指定者:
- 类
FileRenamer 中的 rename
Copyright © 2015. All rights reserved.