org.apache.commons.fileupload.util.Closeable Java Examples

The following examples show how to use org.apache.commons.fileupload.util.Closeable. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: FileUploadBase.java    From Mars-Java with MIT License 5 votes vote down vote up
/**
 * Returns an input stream, which may be used to
 * read the items contents.
 *
 * @return Opened input stream.
 * @throws IOException An I/O error occurred.
 */
public InputStream openStream() throws IOException {
    if (opened) {
        throw new IllegalStateException(
                "The stream was already opened.");
    }
    if (((Closeable) stream).isClosed()) {
        throw new FileItemStream.ItemSkippedException();
    }
    return stream;
}
 
Example #2
Source File: FileUploadBase.java    From steady with Apache License 2.0 5 votes vote down vote up
/**
 * Returns an input stream, which may be used to
 * read the items contents.
 *
 * @return Opened input stream.
 * @throws IOException An I/O error occurred.
 */
public InputStream openStream() throws IOException {
    if (opened) {
        throw new IllegalStateException(
                "The stream was already opened.");
    }
    if (((Closeable) stream).isClosed()) {
        throw new FileItemStream.ItemSkippedException();
    }
    return stream;
}
 
Example #3
Source File: FileUploadBase.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns an input stream, which may be used to
 * read the items contents.
 *
 * @return Opened input stream.
 * @throws IOException An I/O error occurred.
 */
public InputStream openStream() throws IOException {
    if (opened) {
        throw new IllegalStateException(
                "The stream was already opened.");
    }
    if (((Closeable) stream).isClosed()) {
        throw new FileItemStream.ItemSkippedException();
    }
    return stream;
}
 
Example #4
Source File: ApacheMultipartParser.java    From actframework with Apache License 2.0 5 votes vote down vote up
/**
 * Returns an input stream, which may be used to read the items
 * contents.
 *
 * @return Opened input stream.
 * @throws IOException An I/O error occurred.
 */
public InputStream openStream() throws IOException {
    if (opened) {
        throw new IllegalStateException("The stream was already opened.");
    }
    if (((Closeable) stream).isClosed()) {
        throw new FileItemStream.ItemSkippedException();
    }
    return stream;
}
 
Example #5
Source File: ApacheMultipartParser.java    From restcommander with Apache License 2.0 5 votes vote down vote up
/**
 * Returns an input stream, which may be used to read the items
 * contents.
 *
 * @return Opened input stream.
 * @throws IOException An I/O error occurred.
 */
public InputStream openStream() throws IOException {
    if (opened) {
        throw new IllegalStateException("The stream was already opened.");
    }
    if (((Closeable) stream).isClosed()) {
        throw new FileItemStream.ItemSkippedException();
    }
    return stream;
}
 
Example #6
Source File: FileUploadBase.java    From AndroidWebServ with Apache License 2.0 5 votes vote down vote up
/**
 * Returns an input stream, which may be used to
 * read the items contents.
 *
 * @return Opened input stream.
 * @throws IOException An I/O error occurred.
 */
public InputStream openStream() throws IOException {
    if (opened) {
        throw new IllegalStateException(
                "The stream was already opened.");
    }
    if (((Closeable) stream).isClosed()) {
        throw new FileItemStream.ItemSkippedException();
    }
    return stream;
}