Elliotte Rusty Harold created MRESOLVER-672:
-----------------------------------------------

             Summary: Use try with resources
                 Key: MRESOLVER-672
                 URL: https://issues.apache.org/jira/browse/MRESOLVER-672
             Project: Maven Resolver
          Issue Type: Improvement
            Reporter: Elliotte Rusty Harold


Various opportunities including T{color:#000000}estFileProcessor{color}

 

    public void write(File target, InputStream source) throws IOException {
        mkdirs(target.getAbsoluteFile().getParentFile());

        OutputStream fos = null;
        try {
            fos = new BufferedOutputStream(new FileOutputStream(target));

            copy(fos, source, null);

            fos.close();
            fos = null;
        } finally {
            try {
                if (fos != null) {
                    fos.close();
                }
            } catch (final IOException e) {
                // Suppressed due to an exception already thrown in the try 
block.
            }
        }
    }



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to