com.mucommander.file.util
Class PathUtils.ResolvedDestination

java.lang.Object
  extended by com.mucommander.file.util.PathUtils.ResolvedDestination
Enclosing class:
PathUtils

public static class PathUtils.ResolvedDestination
extends java.lang.Object

This class represents a destination entered by the user and resolved by PathUtils.resolveDestination(String, com.mucommander.file.AbstractFile) into an AbstractFile and a destination type.

See Also:
PathUtils.resolveDestination(String, com.mucommander.file.AbstractFile)

Field Summary
static int EXISTING_FILE
          Designates a regular file that exists on the filesystem.
static int EXISTING_FOLDER
          Designates a folder, either a directory or archive, that exists on the filesystem.
static int NEW_FILE
          Designates a new file that doesn't exist on the filesystem.
 
Method Summary
 AbstractFile getDestinationFile()
          Returns the resolved destination file.
 AbstractFile getDestinationFolder()
          Returns the resolved destination's folder.
 int getDestinationType()
          Returns the type of destination that was resolved.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EXISTING_FOLDER

public static final int EXISTING_FOLDER
Designates a folder, either a directory or archive, that exists on the filesystem.

See Also:
Constant Field Values

EXISTING_FILE

public static final int EXISTING_FILE
Designates a regular file that exists on the filesystem. The file may be a browsable archive but that was refered to as a regular file, i.e. without a trailing separator character in the path.

See Also:
Constant Field Values

NEW_FILE

public static final int NEW_FILE
Designates a new file that doesn't exist on the filesystem. The file's parent however does always exist.

See Also:
Constant Field Values
Method Detail

getDestinationFile

public AbstractFile getDestinationFile()
Returns the resolved destination file. The returned file may or may not physically exist on the filesystem. If it exists, the returned file may be a folder (directory or browsable archive) or a regular file.

Returns:
the resolved destination file
See Also:
getDestinationType()

getDestinationFolder

public AbstractFile getDestinationFolder()
Returns the resolved destination's folder. Depending on the destination type, the destination folder is:
for EXISTING_FOLDER
the destination file itself
for EXISTING_FILE or NEW_FILE
the destination file's parent
The returned AbstractFile is always a folder that exists.

Returns:
the resolved destination file
See Also:
getDestinationType()

getDestinationType

public int getDestinationType()
Returns the type of destination that was resolved. The returned value will be one of the following constant fields defined in this class:
EXISTING_FOLDER
if the path denotes a folder, either a directory or a browsable archive.
EXISTING_FILE
if the path denotes a regular file. The file may be a browsable archive, see below.
NEW_FILE
if the path denotes a non-existing file whose parent exists.
Paths to browsable archives are considered as denoting a folder only if they end with a trailing separator character. If they don't, they're considered as denoting a regular file. For example, /existing_folder/existing_archive.zip/ refers to the archive as a folder where as /existing_folder/existing_archive.zip refers to the archive as a regular file.

Returns:
the type of destination that was resolved


This file is part of muCommander - Copyright (C) 2002-2008 Maxence Bernard