Example usage for org.apache.commons.vfs2 FileType IMAGINARY

List of usage examples for org.apache.commons.vfs2 FileType IMAGINARY

Introduction

In this page you can find the example usage for org.apache.commons.vfs2 FileType IMAGINARY.

Prototype

FileType IMAGINARY

To view the source code for org.apache.commons.vfs2 FileType IMAGINARY.

Click Source Link

Document

A file that does not exist.

Usage

From source file:org.wso2.carbon.transport.remotefilesystem.server.RemoteFileSystemConsumer.java

/**
 * Determine whether file object is a file or a folder.
 *
 * @param fileObject    File to get the type of
 * @return              FileType of given file
 *//*from  w w w.  j ava2s  . co  m*/
private FileType getFileType(FileObject fileObject) throws RemoteFileSystemConnectorException {
    try {
        return fileObject.getType();
    } catch (FileSystemException e) {
        remoteFileSystemListener.onError(new RemoteFileSystemConnectorException("[" + serviceName
                + "] Error occurred when determining whether file: "
                + FileTransportUtils.maskURLPassword(fileObject.getName().getURI()) + " is a file or a folder",
                e));
    }

    return FileType.IMAGINARY;
}

From source file:org.ysb33r.groovy.vfsplugin.cpio.CpioFileObject.java

protected CpioFileObject(final AbstractFileName name, final CpioArchiveEntry entry, final CpioFileSystem fs,
        final boolean cpioExists) throws FileSystemException {
    super(name, fs);
    setCpioEntry(entry);//w  w  w  .j  a v  a 2 s  .  c om
    if (!cpioExists) {
        type = FileType.IMAGINARY;
    }
}

From source file:pl.otros.vfs.browser.LinkFileObject.java

@Override
public FileType getType() throws FileSystemException {
    return FileType.IMAGINARY;
}

From source file:pl.otros.vfs.browser.table.FileNameWithTypeTableCellRenderer.java

@Override
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus,
        int row, int column) {

    JLabel label = (JLabel) super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row,
            column);/*from w w w.  j  a  v  a 2s. c om*/
    FileNameWithType fileNameWithType = (FileNameWithType) value;
    FileName fileName = fileNameWithType.getFileName();
    label.setText(fileName.getBaseName());
    label.setToolTipText(fileName.getFriendlyURI());

    FileType fileType = fileNameWithType.getFileType();
    Icon icon = null;
    Icons icons = Icons.getInstance();
    if (fileNameWithType.getFileName().getBaseName().equals(ParentFileObject.PARENT_NAME)) {
        icon = icons.getArrowTurn90();
    } else if (FileType.FOLDER.equals(fileType)) {
        icon = icons.getFolderOpen();
    } else if (VFSUtils.isArchive(fileName)) {
        if ("jar".equalsIgnoreCase(fileName.getExtension())) {
            icon = icons.getJarIcon();
        } else {
            icon = icons.getFolderZipper();
        }
    } else if (FileType.FILE.equals(fileType)) {
        icon = icons.getFile();
    } else if (FileType.IMAGINARY.equals(fileType)) {
        icon = icons.getShortCut();
    }
    label.setIcon(icon);
    return label;
}