Object

resource

Using

Related Doc: package resource

Permalink

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

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def bufferedInputStream(in: ⇒ InputStream): ManagedResource[BufferedInputStream]

    Permalink

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

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

    Permalink

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

  7. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  9. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  10. def file[T](in: (File) ⇒ T)(source: File)(implicit arg0: Resource[T], arg1: OptManifest[T]): ManagedResource[T]

    Permalink

    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]

    Permalink

    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]

    Permalink

    Creates a new BufferedInputStream for a given file.

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

    Permalink

    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]

    Permalink

    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]

    Permalink

    Creates a new BufferedInputStream for a given file.

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

    Permalink

    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]

    Permalink

    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

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  19. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  20. def gzipInputStream(in: ⇒ InputStream): ManagedResource[GZIPInputStream]

    Permalink

    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]

    Permalink

    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

    Permalink
    Definition Classes
    AnyRef → Any
  23. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  24. def jarFile(verify: Boolean)(source: File): ManagedResource[JarFile]

    Permalink

    Constructs a new JarFile reader.

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

    Permalink

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

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

    Permalink

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

  27. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  28. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  29. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  30. def streamReader(in: InputStream, charset: Charset): ManagedResource[Reader]

    Permalink

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

  31. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  32. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  33. def urlInputStream(url: URL): ManagedResource[BufferedInputStream]

    Permalink

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

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

    Permalink

    Constructs a new buffered reader for a URL.

  35. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  36. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  37. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  38. def zipEntry(zip: ZipFile)(entry: ZipEntry): ManagedResource[InputStream]

    Permalink

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

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

    Permalink

    Constructs a new ZipFile reader.

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

    Permalink

    Constructs a new managed ZipInputStream from a normal InputStream.

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

    Permalink

    Constructs a new managed ZipOutputStream from a normal OutputStream.

Inherited from UsingCompat

Inherited from AnyRef

Inherited from Any

Ungrouped