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.
- Alphabetic
- By Inheritance
- Using
- UsingCompat
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
bufferedInputStream(in: ⇒ InputStream): ManagedResource[BufferedInputStream]
Converts a function which creates an InputStream into a ManagedResource[BufferedInputStream].
-
def
bufferedOutputStream(out: ⇒ OutputStream): ManagedResource[BufferedOutputStream]
Converts a function which creates an OutputStream into a ManagedResource[BufferedOutputStream].
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
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.
-
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.
-
def
fileInputStream(source: File): ManagedResource[BufferedInputStream]
Creates a new BufferedInputStream for a given file.
-
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
-
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.
-
def
fileOutputStream(source: File): ManagedResource[BufferedOutputStream]
Creates a new BufferedInputStream for a given file.
-
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.
-
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.
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
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.
-
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.
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
jarFile(verify: Boolean)(source: File): ManagedResource[JarFile]
Constructs a new JarFile reader.
-
def
jarInputStream(in: ⇒ InputStream): ManagedResource[JarInputStream]
Creates a resource which converts an InputStream into a JarInputStream and ensures it is closed.
-
def
jarOutputStream(out: ⇒ OutputStream): ManagedResource[JarOutputStream]
Creates a resource which converts an OutputStream into a JarOutputStream and ensures it is closed.
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
def
streamReader(in: InputStream, charset: Charset): ManagedResource[Reader]
Creates a new managed Reader which reads from an input stream using the given charset.
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
def
urlInputStream(url: URL): ManagedResource[BufferedInputStream]
Creates a new input stream from a java.net.URL.
-
def
urlReader(charset: Charset)(u: URL): ManagedResource[BufferedReader]
Constructs a new buffered reader for a URL.
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
def
zipEntry(zip: ZipFile)(entry: ZipEntry): ManagedResource[InputStream]
Creates a resource which opens/closes for a particular entry in a zip file.
-
def
zipFile(source: File): ManagedResource[ZipFile]
Constructs a new ZipFile reader.
-
def
zipInputStream(in: ⇒ InputStream): ManagedResource[ZipInputStream]
Constructs a new managed ZipInputStream from a normal InputStream.
-
def
zipOutputStream(out: ⇒ OutputStream): ManagedResource[ZipOutputStream]
Constructs a new managed ZipOutputStream from a normal OutputStream.