|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.mucommander.job.FileCollisionChecker
public class FileCollisionChecker
The purpose of this class is to check for collisions between a source and destination file used in a file transfer.
Currently, 3 collision types are detected:
DESTINATION_FILE_ALREADY_EXISTS: the destination file already exists
SAME_SOURCE_AND_DESTINATION: source and destination files are the same, according to AbstractFile.equals(Object)
SOURCE_PARENT_OF_DESTINATION: source is a folder (as returned by AbstractFile.isBrowsable()
and a parent of destination.
The value returned by checkForCollision(com.mucommander.file.AbstractFile, com.mucommander.file.AbstractFile)
can be used to create a FileCollisionDialog in order to inform the user of the collision
and ask him how to resolve it.
FileCollisionDialog| Field Summary | |
|---|---|
static int |
DESTINATION_FILE_ALREADY_EXISTS
The destination file already exists and is not a directory |
static int |
NO_COLLOSION
No collision detected |
static int |
SAME_SOURCE_AND_DESTINATION
Source and destination files are the same |
static int |
SOURCE_PARENT_OF_DESTINATION
Source and destination are both folders and destination is a subfolder of source |
| Constructor Summary | |
|---|---|
FileCollisionChecker()
|
|
| Method Summary | |
|---|---|
static int |
checkForCollision(AbstractFile sourceFile,
AbstractFile destFile)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int NO_COLLOSION
public static final int DESTINATION_FILE_ALREADY_EXISTS
public static final int SAME_SOURCE_AND_DESTINATION
public static final int SOURCE_PARENT_OF_DESTINATION
| Constructor Detail |
|---|
public FileCollisionChecker()
| Method Detail |
|---|
public static int checkForCollision(AbstractFile sourceFile,
AbstractFile destFile)
sourceFile - source file, can be null in which case the only collision checked against is DESTINATION_FILE_ALREADY_EXISTS.destFile - destination file, cannot be null
NO_COLLOSION if no collision was detected (see constants)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
This file is part of muCommander - Copyright (C) 2002-2008 Maxence Bernard