java.io.FilterReader Java Examples

The following examples show how to use java.io.FilterReader. 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: TemporaryClob.java    From spliceengine with GNU Affero General Public License v3.0 6 votes vote down vote up
/**
 * @see #getReader
 */
public Reader getInternalReader(long characterPosition)
        throws IOException, SQLException {
    if (this.internalReader == null) {
        // getCSD obtains a descriptor for the stream to allow the reader
        // to configure itself.
        this.internalReader = new UTF8Reader(getCSD(), conChild,
                conChild.getConnectionSynchronization());
        this.unclosableInternalReader =
                new FilterReader(this.internalReader) {
                    public void close() {
                        // Do nothing.
                        // Stream will be closed when the Clob is released.
                    }
                };
    }
    try {
        this.internalReader.reposition(characterPosition);
    } catch (StandardException se) {
        throw Util.generateCsSQLException(se);
    }
    return this.unclosableInternalReader;
}
 
Example #2
Source File: DefaultCopySpec.java    From pushfish-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public CopySpec filter(final Class<? extends FilterReader> filterType) {
    copyActions.add(new Action<FileCopyDetails>() {
        public void execute(FileCopyDetails fileCopyDetails) {
            fileCopyDetails.filter(filterType);
        }
    });
    return this;
}
 
Example #3
Source File: DefaultCopySpec.java    From pushfish-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public CopySpec filter(final Map<String, ?> properties, final Class<? extends FilterReader> filterType) {
    copyActions.add(new Action<FileCopyDetails>() {
        public void execute(FileCopyDetails fileCopyDetails) {
            fileCopyDetails.filter(properties, filterType);
        }
    });
    return this;
}
 
Example #4
Source File: SafeXMLParsing.java    From lucene-solr with Apache License 2.0 5 votes vote down vote up
/** Parses the given InputStream as XML, disabling any external entities with secure processing enabled.
 * The given Reader is not closed. */
public static Document parseUntrustedXML(Logger log, Reader reader) throws SAXException, IOException {
  final InputSource is = new InputSource(new FilterReader(reader) {
    @Override public void close() {}
  });
  is.setSystemId(SYSTEMID_UNTRUSTED);
  return getUntrustedDocumentBuilder(log).parse(is);
}
 
Example #5
Source File: DefaultCopySpec.java    From pushfish-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public CopySpec filter(final Class<? extends FilterReader> filterType) {
    actions.add(new Action<FileCopyDetails>() {
        public void execute(FileCopyDetails fileCopyDetails) {
            fileCopyDetails.filter(filterType);
        }
    });
    return this;
}
 
Example #6
Source File: DefaultCopySpec.java    From pushfish-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public CopySpec filter(final Map<String, ?> properties, final Class<? extends FilterReader> filterType) {
    actions.add(new Action<FileCopyDetails>() {
        public void execute(FileCopyDetails fileCopyDetails) {
            fileCopyDetails.filter(properties, filterType);
        }
    });
    return this;
}
 
Example #7
Source File: JShellEnvironment.java    From netbeans with Apache License 2.0 5 votes vote down vote up
public InputStream getInputStream() throws IOException {
    if (inputOutput == null) {
        throw new IllegalStateException("not started");
    }
    return new ReaderInputStream(
            new FilterReader(inputOutput.getIn()) {
                @Override
                public void close() throws IOException {
                    // do not close the input, JShell may be reset.
                }
            }, "UTF-8" // NOI18N
    );
}
 
Example #8
Source File: Parseable.java    From waterdrop with Apache License 2.0 5 votes vote down vote up
private static Reader doNotClose(Reader input) {
    return new FilterReader(input) {
        @Override
        public void close() {
            // NOTHING.
        }
    };
}
 
Example #9
Source File: JsonSupport.java    From FHIR with Apache License 2.0 5 votes vote down vote up
public static Reader nonClosingReader(Reader reader) {
    return new FilterReader(reader) {
        @Override
        public void close() {
            // do nothing
        }
    };
}
 
Example #10
Source File: DefaultCopySpec.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public CopySpec filter(final Class<? extends FilterReader> filterType) {
    copyActions.add(new Action<FileCopyDetails>() {
        public void execute(FileCopyDetails fileCopyDetails) {
            fileCopyDetails.filter(filterType);
        }
    });
    return this;
}
 
Example #11
Source File: DefaultCopySpec.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public CopySpec filter(final Map<String, ?> properties, final Class<? extends FilterReader> filterType) {
    copyActions.add(new Action<FileCopyDetails>() {
        public void execute(FileCopyDetails fileCopyDetails) {
            fileCopyDetails.filter(properties, filterType);
        }
    });
    return this;
}
 
Example #12
Source File: DefaultCopySpec.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public CopySpec filter(final Class<? extends FilterReader> filterType) {
    actions.add(new Action<FileCopyDetails>() {
        public void execute(FileCopyDetails fileCopyDetails) {
            fileCopyDetails.filter(filterType);
        }
    });
    return this;
}
 
Example #13
Source File: DefaultCopySpec.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public CopySpec filter(final Map<String, ?> properties, final Class<? extends FilterReader> filterType) {
    actions.add(new Action<FileCopyDetails>() {
        public void execute(FileCopyDetails fileCopyDetails) {
            fileCopyDetails.filter(properties, filterType);
        }
    });
    return this;
}
 
Example #14
Source File: OldFilterReaderTest.java    From j2objc with Apache License 2.0 5 votes vote down vote up
public void test_ConstructorLjava_io_Reader() {

        FilterReader myReader = null;

        called = true;

        try {
            myReader = new MyFilterReader(null);
            fail("NullPointerException expected.");
        } catch (NullPointerException e) {
            // expected
        }
    }
 
Example #15
Source File: Parseable.java    From PlayerVaults with GNU General Public License v3.0 5 votes vote down vote up
private static Reader doNotClose(Reader input) {
    return new FilterReader(input) {
        @Override
        public void close() {
            // NOTHING.
        }
    };
}
 
Example #16
Source File: NormalizingCopyActionDecorator.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public ContentFilterable filter(Class<? extends FilterReader> filterType) {
    throw new UnsupportedOperationException();
}
 
Example #17
Source File: CopySpecWrapper.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public CopySpec filter(Map<String, ?> properties, Class<? extends FilterReader> filterType) {
    delegate.filter(properties, filterType);
    return this;
}
 
Example #18
Source File: AbstractCopyTask.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
/**
 * {@inheritDoc}
 */
public AbstractCopyTask filter(Class<? extends FilterReader> filterType) {
    getMainSpec().filter(filterType);
    return this;
}
 
Example #19
Source File: AbstractCopyTask.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
/**
 * {@inheritDoc}
 */
public AbstractCopyTask filter(Map<String, ?> properties, Class<? extends FilterReader> filterType) {
    getMainSpec().filter(properties, filterType);
    return this;
}
 
Example #20
Source File: NormalizingCopyActionDecorator.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public ContentFilterable filter(Map<String, ?> properties, Class<? extends FilterReader> filterType) {
    throw new UnsupportedOperationException();
}
 
Example #21
Source File: AbstractCopyTask.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
/**
 * {@inheritDoc}
 */
public AbstractCopyTask filter(Class<? extends FilterReader> filterType) {
    getMainSpec().filter(filterType);
    return this;
}
 
Example #22
Source File: DelegatingCopySpecInternal.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public CopySpec filter(Map<String, ?> properties, Class<? extends FilterReader> filterType) {
    return getDelegateCopySpec().filter(properties, filterType);
}
 
Example #23
Source File: AbstractCopyTask.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
/**
 * {@inheritDoc}
 */
public AbstractCopyTask filter(Map<String, ?> properties, Class<? extends FilterReader> filterType) {
    getMainSpec().filter(properties, filterType);
    return this;
}
 
Example #24
Source File: NormalizingCopyActionDecorator.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public ContentFilterable filter(Class<? extends FilterReader> filterType) {
    throw new UnsupportedOperationException();
}
 
Example #25
Source File: NormalizingCopyActionDecorator.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public ContentFilterable filter(Map<String, ?> properties, Class<? extends FilterReader> filterType) {
    throw new UnsupportedOperationException();
}
 
Example #26
Source File: DelegatingCopySpecInternal.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public CopySpec filter(Class<? extends FilterReader> filterType) {
    return getDelegateCopySpec().filter(filterType);
}
 
Example #27
Source File: DelegatingCopySpecInternal.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public CopySpec filter(Map<String, ?> properties, Class<? extends FilterReader> filterType) {
    return getDelegateCopySpec().filter(properties, filterType);
}
 
Example #28
Source File: CopySpecWrapper.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public CopySpec filter(Class<? extends FilterReader> filterType) {
    delegate.filter(filterType);
    return this;
}
 
Example #29
Source File: CopySpecWrapper.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public CopySpec filter(Map<String, ?> properties, Class<? extends FilterReader> filterType) {
    delegate.filter(properties, filterType);
    return this;
}
 
Example #30
Source File: CopySpecWrapper.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public CopySpec filter(Class<? extends FilterReader> filterType) {
    delegate.filter(filterType);
    return this;
}