org.meshcms.webui
Class FileClipboard

java.lang.Object
  extended byorg.meshcms.webui.FileClipboard

public class FileClipboard
extends java.lang.Object

A simple class to store path and names of files selected with the cut and copy features of the file manager.


Constructor Summary
FileClipboard()
          Creates a new clipboard (usually one clipboard per session should be used).
 
Method Summary
 void clear()
          Marks the clipboard as empty.
 int countFiles()
          Returns the number of files in the clipboard.
 Path[] getContent()
          Retrieves the content of the clipboard.
 Path getDirPath()
          Returns the path of the directory where the files are located
 java.lang.String[] getFileNames()
          Returns the file names.
 boolean isCut()
          Returns true for the "cut" operation, false for the "copy"
 void setContent(Path dirPath, java.lang.String names, boolean cut)
          Sets the content of the clipboard.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileClipboard

public FileClipboard()
Creates a new clipboard (usually one clipboard per session should be used).

Method Detail

setContent

public void setContent(Path dirPath,
                       java.lang.String names,
                       boolean cut)
Sets the content of the clipboard.

Parameters:
dirPath - the path of the directory where the files are located
names - a comma-separated list of the file names
cut - true for the "cut" operation, false for the "copy"

getContent

public Path[] getContent()
Retrieves the content of the clipboard.

Returns:
an array of file paths

clear

public void clear()
Marks the clipboard as empty.


countFiles

public int countFiles()
Returns the number of files in the clipboard.


getDirPath

public Path getDirPath()
Returns the path of the directory where the files are located


getFileNames

public java.lang.String[] getFileNames()
Returns the file names.


isCut

public boolean isCut()
Returns true for the "cut" operation, false for the "copy"