com.oreilly.servlet.multipart
类 DefaultFileRenamePolicy

java.lang.Object
  继承者 com.oreilly.servlet.multipart.DefaultFileRenamePolicy
所有已实现的接口:
FileRenamePolicy

public class DefaultFileRenamePolicy
extends Object
implements FileRenamePolicy

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.1, 2002/11/05, making thread safe with createNewFile(), 1.0, 2002/04/30, initial revision, thanks to Yoonjung Lee for this idea
作者:
Jason Hunter

构造方法摘要
DefaultFileRenamePolicy()
           
 
方法摘要
 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
 

构造方法详细信息

DefaultFileRenamePolicy

public DefaultFileRenamePolicy()
方法详细信息

rename

public File rename(File f)
从接口 FileRenamePolicy 复制的描述
Returns a File object holding a new name for the specified file.

指定者:
接口 FileRenamePolicy 中的 rename
另请参见:
FilePart.writeTo(File fileOrDirectory)


Copyright © 2013. All Rights Reserved.