net.shredzone.ifish.db
Interface RenameCallback

All Known Implementing Classes:
IFishRenameCallback, RenameCallback.DefaultRenameCallback, SmartRenameCallback

public interface RenameCallback

If a class is implementing the RenameCallback, it will be invoked during database synchronisation, if a directory or file name is longer than 52 characters. Its task is to either rename the file to fit the filename length constrains, or throw an DatabaseException to abort the database creation.

Currently, directory renaming is not supported!

Version:
$Id: RenameCallback.java 291 2009-04-28 21:29:27Z shred $

Nested Class Summary
static class RenameCallback.DefaultRenameCallback
          A default implementation of the RenameCallback which will always fail throwing a DatabaseException.
 
Method Summary
 File renameDirectory(File base, File directory)
          A directory name exceeded the maximum length of 52 characters.
 File renameFile(File base, File file)
          A file name exceeded the maximum length of 52 characters.
 

Method Detail

renameDirectory

File renameDirectory(File base,
                     File directory)
                     throws DatabaseException,
                            IOException
A directory name exceeded the maximum length of 52 characters. This method will either rename the directory and return the new directory name, or throw a DatabaseException.

NOTE: Currently, directory renaming is not supported, so an implementation MUST always throw a DatabaseException.

Parameters:
base - Base directory (jukebox mount point)
directory - Directory with the bad name
Returns:
Directory's new name
Throws:
DatabaseException - Directory could not be renamed
IOException - An IO error occured during nenaming

renameFile

File renameFile(File base,
                File file)
                throws DatabaseException,
                       IOException
A file name exceeded the maximum length of 52 characters. This method will either rename the file and return the new file name, or throw a DatabaseException.

Parameters:
base - Base directory (jukebox mount point)
file - File with the bad name
Returns:
New file name
Throws:
DatabaseException - Directory could not be renamed
IOException - An IO error occured during nenaming


Copyright © 2007-2011 shredzone.org. All Rights Reserved.