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 Project: spliceengine   Author: splicemachine   File: TemporaryClob.java    License: 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 Project: FHIR   Author: IBM   File: JsonSupport.java    License: 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 #3
Source Project: pushfish-android   Author: PushFish   File: DefaultCopySpec.java    License: 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 #4
Source Project: pushfish-android   Author: PushFish   File: DefaultCopySpec.java    License: 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 #5
Source Project: pushfish-android   Author: PushFish   File: DefaultCopySpec.java    License: 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 Project: pushfish-android   Author: PushFish   File: DefaultCopySpec.java    License: 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 Project: netbeans   Author: apache   File: JShellEnvironment.java    License: 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 Project: waterdrop   Author: InterestingLab   File: Parseable.java    License: 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 Project: lucene-solr   Author: apache   File: SafeXMLParsing.java    License: 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 #10
Source Project: Pushjet-Android   Author: Pushjet   File: DefaultCopySpec.java    License: 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 Project: Pushjet-Android   Author: Pushjet   File: DefaultCopySpec.java    License: 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 Project: Pushjet-Android   Author: Pushjet   File: DefaultCopySpec.java    License: 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 Project: Pushjet-Android   Author: Pushjet   File: DefaultCopySpec.java    License: 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 Project: j2objc   Author: google   File: OldFilterReaderTest.java    License: 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 Project: PlayerVaults   Author: drtshock   File: Parseable.java    License: 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 Project: pushfish-android   Author: PushFish   File: AbstractCopyTask.java    License: 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 #17
Source Project: pushfish-android   Author: PushFish   File: AbstractCopyTask.java    License: 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 #18
Source Project: pushfish-android   Author: PushFish   File: CopySpecWrapper.java    License: 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 #19
Source Project: pushfish-android   Author: PushFish   File: CopySpecWrapper.java    License: BSD 2-Clause "Simplified" License 4 votes vote down vote up
public CopySpec filter(Class<? extends FilterReader> filterType) {
    delegate.filter(filterType);
    return this;
}
 
Example #20
Source Project: pushfish-android   Author: PushFish   File: DelegatingCopySpecInternal.java    License: 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 #21
Source Project: pushfish-android   Author: PushFish   File: DelegatingCopySpecInternal.java    License: BSD 2-Clause "Simplified" License 4 votes vote down vote up
public CopySpec filter(Class<? extends FilterReader> filterType) {
    return getDelegateCopySpec().filter(filterType);
}
 
Example #22
Source Project: pushfish-android   Author: PushFish   File: NormalizingCopyActionDecorator.java    License: 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 #23
Source Project: pushfish-android   Author: PushFish   File: NormalizingCopyActionDecorator.java    License: BSD 2-Clause "Simplified" License 4 votes vote down vote up
public ContentFilterable filter(Class<? extends FilterReader> filterType) {
    throw new UnsupportedOperationException();
}
 
Example #24
Source Project: pushfish-android   Author: PushFish   File: AbstractCopyTask.java    License: 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 #25
Source Project: pushfish-android   Author: PushFish   File: AbstractCopyTask.java    License: 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 #26
Source Project: pushfish-android   Author: PushFish   File: CopySpecWrapper.java    License: 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 #27
Source Project: pushfish-android   Author: PushFish   File: CopySpecWrapper.java    License: BSD 2-Clause "Simplified" License 4 votes vote down vote up
public CopySpec filter(Class<? extends FilterReader> filterType) {
    delegate.filter(filterType);
    return this;
}
 
Example #28
Source Project: pushfish-android   Author: PushFish   File: DelegatingCopySpecInternal.java    License: 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 #29
Source Project: pushfish-android   Author: PushFish   File: DelegatingCopySpecInternal.java    License: BSD 2-Clause "Simplified" License 4 votes vote down vote up
public CopySpec filter(Class<? extends FilterReader> filterType) {
    return getDelegateCopySpec().filter(filterType);
}
 
Example #30
Source Project: pushfish-android   Author: PushFish   File: NormalizingCopyActionDecorator.java    License: BSD 2-Clause "Simplified" License 4 votes vote down vote up
public ContentFilterable filter(Map<String, ?> properties, Class<? extends FilterReader> filterType) {
    throw new UnsupportedOperationException();
}