Example usage for org.apache.commons.vfs2 FileTypeHasNoContentException FileTypeHasNoContentException

List of usage examples for org.apache.commons.vfs2 FileTypeHasNoContentException FileTypeHasNoContentException

Introduction

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

Prototype

public FileTypeHasNoContentException(final Object info0) 

Source Link

Usage

From source file:com.github.songsheng.vfs2.provider.nfs.NfsFileObject.java

/**
 * Creates an input stream to read the file content from.
 *///from www. j ava2  s .  com
@Override
protected InputStream doGetInputStream() throws Exception {
    try {
        return new XFileInputStream(file);
    } catch (final Exception e) {
        if (file.isDirectory()) {
            throw new FileTypeHasNoContentException(getName());
        } else {
            throw new org.apache.commons.vfs2.FileNotFoundException(getName());
        }
    }
}