org.eclipse.oomph.util

## Class IOUtil

- java.lang.Object
- - org.eclipse.oomph.util.IOUtil

-     public final class IOUtil
      extends Object

  Author:
    Eike Stepper

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static void` | `close(Closeable closeable)`
    `static Exception` | `closeSilent(Closeable closeable)`
    `static Exception` | `closeSilent(ServerSocket socket)`
    `static Exception` | `closeSilent(Socket socket)`
    `static long` | `copy(InputStream input, OutputStream output)`
    `static long` | `copy(InputStream input, OutputStream output, byte[] buffer)`
    `static long` | `copy(InputStream input, OutputStream output, int bufferSize)`
    `static void` | `copyFile(File source, File target)`
    `static void` | `copyTree(File source, File target)`
    `static boolean` | `deleteBestEffort(File file)`
    `static boolean` | `deleteBestEffort(File file, boolean deleteOnExit)`
    `static Serializable` | `deserialize(byte[] bytes)`
    `static Serializable` | `deserialize(byte[] bytes, ClassLoader classLoader)`
    `static String` | `encodeFileName(String path)`
    `static byte[]` | `getSHA1(InputStream contents)`
    `static byte[]` | `getSHA1(String contents)`
    `static boolean` | `isSerializeable(Object object)`
    `static List<File>` | `listBreadthFirst(File file)`
    `static List<File>` | `listDepthFirst(File file)`
    `static void` | `mkdirs(File folder)`
    `static FileInputStream` | `openInputStream(File file)`
    `static FileOutputStream` | `openOutputStream(File file)`
    `static byte[]` | `readFile(File file)`
    `static List<String>` | `readLines(File file, String charsetName)`
    `static String` | `readUTF8(File file)`
    `static String` | `readXML(InputStream inputStream)`
    `static byte[]` | `serialize(Serializable object)`
    `static void` | `writeFile(File file, byte[] bytes)`
    `static void` | `writeLines(File file, String charsetName, List<String> lines)`
    `static void` | `writeUTF8(File file, String contents)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### isSerializeable

          public static boolean isSerializeable(Object object)

    - #### serialize

          public static byte[] serialize(Serializable object)

    - #### deserialize

          public static Serializable deserialize(byte[] bytes)

    - #### deserialize

          public static Serializable deserialize(byte[] bytes,
                                 ClassLoader classLoader)

    - #### getSHA1

          public static byte[] getSHA1(String contents)
                                throws NoSuchAlgorithmException,
                                       IOException

      Throws:
        `NoSuchAlgorithmException`
        `IOException`

    - #### getSHA1

          public static byte[] getSHA1(InputStream contents)
                                throws NoSuchAlgorithmException,
                                       IOException

      Throws:
        `NoSuchAlgorithmException`
        `IOException`

    - #### encodeFileName

          public static String encodeFileName(String path)

    - #### openInputStream

          public static FileInputStream openInputStream(File file)
                                                 throws IORuntimeException

      Throws:
        `IORuntimeException`

    - #### openOutputStream

          public static FileOutputStream openOutputStream(File file)
                                                   throws IORuntimeException

      Throws:
        `IORuntimeException`

    - #### closeSilent

          public static Exception closeSilent(Closeable closeable)

    - #### closeSilent

          public static Exception closeSilent(Socket socket)

    - #### closeSilent

          public static Exception closeSilent(ServerSocket socket)

    - #### close

          public static void close(Closeable closeable)
                            throws IORuntimeException

      Throws:
        `IORuntimeException`

    - #### mkdirs

          public static void mkdirs(File folder)
                             throws IORuntimeException

      Throws:
        `IORuntimeException`

    - #### deleteBestEffort

          public static boolean deleteBestEffort(File file)

    - #### deleteBestEffort

          public static boolean deleteBestEffort(File file,
                                 boolean deleteOnExit)

    - #### copy

          public static long copy(InputStream input,
                  OutputStream output,
                  byte[] buffer)
                           throws IORuntimeException

      Throws:
        `IORuntimeException`

    - #### copy

          public static long copy(InputStream input,
                  OutputStream output,
                  int bufferSize)
                           throws IORuntimeException

      Throws:
        `IORuntimeException`

    - #### copy

          public static long copy(InputStream input,
                  OutputStream output)
                           throws IORuntimeException

      Throws:
        `IORuntimeException`

    - #### copyTree

          public static void copyTree(File source,
                      File target)
                               throws IORuntimeException

      Throws:
        `IORuntimeException`

    - #### copyFile

          public static void copyFile(File source,
                      File target)
                               throws IORuntimeException

      Throws:
        `IORuntimeException`

    - #### readFile

          public static byte[] readFile(File file)
                                 throws IORuntimeException

      Throws:
        `IORuntimeException`

    - #### writeFile

          public static void writeFile(File file,
                       byte[] bytes)
                                throws IORuntimeException

      Throws:
        `IORuntimeException`

    - #### readLines

          public static List<String> readLines(File file,
                               String charsetName)

    - #### writeLines

          public static void writeLines(File file,
                        String charsetName,
                        List<String> lines)

    - #### readUTF8

          public static String readUTF8(File file)
                                 throws Exception

      Throws:
        `Exception`

    - #### writeUTF8

          public static void writeUTF8(File file,
                       String contents)
                                throws Exception

      Throws:
        `Exception`

    - #### readXML

          public static String readXML(InputStream inputStream)
                                throws Exception

      Throws:
        `Exception`

    - #### listDepthFirst

          public static List<File> listDepthFirst(File file)

    - #### listBreadthFirst

          public static List<File> listBreadthFirst(File file)

Copyright (c) 2014 Eike Stepper (Loehne, Germany) and others.
All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v2.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v20.html