Package org.apache.commons.io.input

Examples of org.apache.commons.io.input.AutoCloseInputStream


        final List<String> resources = (List<String>)crankstartContext.getAttribute(CONTEXT_ATTRIBUTE_NAME);
       
        final List<InstallableResource> toRegister = new LinkedList<InstallableResource>();
        for(String resourceRef : resources) {
            final URL url = new URL(resourceRef);
            final InputStream stream = new AutoCloseInputStream(url.openStream());
            final String digest = resourceRef;
            toRegister.add(new InstallableResource(resourceRef, stream, null, digest, "file", 100));
        }
       
        if(toRegister.isEmpty()) {
View Full Code Here


    /** Wrapper around {@link #getValue()} */
    public InputStream getStream() throws RepositoryException {
        final Binary binary = getValue().getBinary();
        // make sure binary is disposed after stream had been consumed
        return new AutoCloseInputStream(binary.getStream()) {
            public void close() throws IOException {
                super.close();
                binary.dispose();
            }
        };
View Full Code Here

        BeanBuilder builder = new BeanBuilder();
        String fileName = "LDAPBindSecurityRealm.groovy";
        try {
            File override = new File(Jenkins.getInstance().getRootDir(), fileName);
            builder.parse(
                    override.exists() ? new AutoCloseInputStream(new FileInputStream(override)) :
                    Jenkins.getInstance().servletContext.getResourceAsStream("/WEB-INF/security/"+ fileName),binding);
        } catch (FileNotFoundException e) {
            throw new Error("Failed to load "+fileName,e);
        }
        WebApplicationContext appContext = builder.createApplicationContext();
View Full Code Here

    }

    public InputStream getStream() throws RepositoryException {
        final Binary bin = getValue().getBinary();
        // make sure binary is disposed after stream had been consumed
        return new AutoCloseInputStream(bin.getStream()) {
            public void close() throws IOException {
                super.close();
                bin.dispose();
            }
        };
View Full Code Here

    /** Wrapper around {@link #getValue()} */
    public InputStream getStream() throws RepositoryException {
        final Binary binary = getValue().getBinary();
        // make sure binary is disposed after stream had been consumed
        return new AutoCloseInputStream(binary.getStream()) {
            public void close() throws IOException {
                super.close();
                binary.dispose();
            }
        };
View Full Code Here

    /** Wrapper around {@link #getValue()} */
    public InputStream getStream() throws RepositoryException {
        final Binary binary = getValue().getBinary();
        // make sure binary is disposed after stream had been consumed
        return new AutoCloseInputStream(binary.getStream()) {
            @Override
            public void close() throws IOException {
                super.close();
                binary.dispose();
            }
View Full Code Here

    }

    public InputStream getStream() throws RepositoryException {
        final Binary bin = getValue().getBinary();
        // make sure binary is disposed after stream had been consumed
        return new AutoCloseInputStream(bin.getStream()) {
            public void close() throws IOException {
                super.close();
                bin.dispose();
            }
        };
View Full Code Here

    }

    public InputStream getStream() throws RepositoryException {
        final Binary bin = getValue().getBinary();
        // make sure binary is disposed after stream had been consumed
        return new AutoCloseInputStream(bin.getStream()) {
            public void close() throws IOException {
                super.close();
                bin.dispose();
            }
        };
View Full Code Here

   * </p>
   *
   * @param data The {@link ByteBuffer} to read from.
   */
  public static BEValue bdecode(ByteBuffer data) throws IOException {
    return BDecoder.bdecode(new AutoCloseInputStream(
      new ByteArrayInputStream(data.array())));
  }
View Full Code Here

    }

    public InputStream getStream() throws RepositoryException {
        final Binary bin = getValue().getBinary();
        // make sure binary is disposed after stream had been consumed
        return new AutoCloseInputStream(bin.getStream()) {
            public void close() throws IOException {
                super.close();
                bin.dispose();
            }
        };
View Full Code Here

TOP

Related Classes of org.apache.commons.io.input.AutoCloseInputStream

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.