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

字段摘要
 
从类 cn.dreampie.common.util.stream.FileRenamer 继承的字段
RENAMER
 
构造方法摘要
DefaultFileRenamer()
           
 
方法摘要
 File rename(File f)
          Returns a File object holding a new name for the specified file.
 
从类 cn.dreampie.common.util.stream.FileRenamer 继承的方法
createNewFile
 
从类 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.