o

resource

Using

object Using extends UsingCompat

Convenience methods for common java IO operations.

This API attempts to do two things:

1. Clean up common Java IO operations and conversions, e.g. always returning "Buffered" streams rather than raw ones. 2. Avoid frustrating errors when dealing with the filesystem, e.g. trying to write to a file whose parent directories do not exist yet.

*Note:* This code is ported from the sbt IO library.

Linear Supertypes
UsingCompat, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Using
  2. UsingCompat
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def bufferedInputStream(in: ⇒ InputStream): ManagedResource[BufferedInputStream]

    Converts a function which creates an InputStream into a ManagedResource[BufferedInputStream].

  6. def bufferedOutputStream(out: ⇒ OutputStream): ManagedResource[BufferedOutputStream]

    Converts a function which creates an OutputStream into a ManagedResource[BufferedOutputStream].

  7. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  8. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  9. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  10. def file[T](in: (File) ⇒ T)(source: File)(implicit arg0: Resource[T], arg1: OptManifest[T]): ManagedResource[T]

    Creates a managed resource which works against something constructed out of a file.

    Creates a managed resource which works against something constructed out of a file.

    Note: This ensures that the directory in which the file lives is created prior to opening the resource, which is why it has a bit of an odd signature.

  11. def fileInputChannel(source: File): ManagedResource[FileChannel]

    Creates a new FileChannel given an input file.

    Creates a new FileChannel given an input file. Note: This will ensure the parent directory for the file exists before opening.

  12. def fileInputStream(source: File): ManagedResource[BufferedInputStream]

    Creates a new BufferedInputStream for a given file.

  13. def fileLines(charset: Charset)(source: File): Traversable[String]

    Returns a Traversable which will open and read a file's lines every time it is traversed.

    Returns a Traversable which will open and read a file's lines every time it is traversed.

    Definition Classes
    UsingCompat
  14. def fileOuputChannel(source: File): ManagedResource[FileChannel]

    Creates a new FileOutputChannel given a file.

    Creates a new FileOutputChannel given a file. Note: This will ensure the parent directory for the file exists before opening the file.

  15. def fileOutputStream(source: File): ManagedResource[BufferedOutputStream]

    Creates a new BufferedInputStream for a given file.

  16. def fileReader(charset: Charset)(source: File): ManagedResource[BufferedReader]

    Constructs a file reader for a file.

    Constructs a file reader for a file. Defaults to UTF-8 encoding if no other encoding is specified.

  17. def fileWriter(charset: Charset = utf8, append: Boolean = false)(source: File): ManagedResource[BufferedWriter]

    Constructs a file writer for a file.

    Constructs a file writer for a file. Defaults to UTF-8 encoding if no other encoding is specified.

  18. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  19. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  20. def gzipInputStream(in: ⇒ InputStream): ManagedResource[GZIPInputStream]

    Constructs a new managed GzipInputStream from a normal IntputStream.

    Constructs a new managed GzipInputStream from a normal IntputStream. Note: Default buffer size is 8192.

  21. def gzipOutputStream(out: ⇒ OutputStream): ManagedResource[GZIPOutputStream]

    Constructs a new outpustream which ensures the GZIP is "finished" after completing our operation.

    Constructs a new outpustream which ensures the GZIP is "finished" after completing our operation.

    *Note:* Default buffer size is 8192.

  22. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  23. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  24. def jarFile(verify: Boolean)(source: File): ManagedResource[JarFile]

    Constructs a new JarFile reader.

  25. def jarInputStream(in: ⇒ InputStream): ManagedResource[JarInputStream]

    Creates a resource which converts an InputStream into a JarInputStream and ensures it is closed.

  26. def jarOutputStream(out: ⇒ OutputStream): ManagedResource[JarOutputStream]

    Creates a resource which converts an OutputStream into a JarOutputStream and ensures it is closed.

  27. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  28. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  29. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  30. def streamReader(in: InputStream, charset: Charset): ManagedResource[Reader]

    Creates a new managed Reader which reads from an input stream using the given charset.

  31. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  32. def toString(): String
    Definition Classes
    AnyRef → Any
  33. def urlInputStream(url: URL): ManagedResource[BufferedInputStream]

    Creates a new input stream from a java.net.URL.

  34. def urlReader(charset: Charset)(u: URL): ManagedResource[BufferedReader]

    Constructs a new buffered reader for a URL.

  35. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  36. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  37. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  38. def zipEntry(zip: ZipFile)(entry: ZipEntry): ManagedResource[InputStream]

    Creates a resource which opens/closes for a particular entry in a zip file.

  39. def zipFile(source: File): ManagedResource[ZipFile]

    Constructs a new ZipFile reader.

  40. def zipInputStream(in: ⇒ InputStream): ManagedResource[ZipInputStream]

    Constructs a new managed ZipInputStream from a normal InputStream.

  41. def zipOutputStream(out: ⇒ OutputStream): ManagedResource[ZipOutputStream]

    Constructs a new managed ZipOutputStream from a normal OutputStream.

Inherited from UsingCompat

Inherited from AnyRef

Inherited from Any

Ungrouped