static class SourceFile.OnDisk extends SourceFile
SourceFile.AtUrl, SourceFile.Builder, SourceFile.Generated, SourceFile.Generator, SourceFile.OnDisk, SourceFile.Preloaded
Modifier and Type | Field and Description |
---|---|
private File |
file |
private java.lang.String |
inputCharset |
private static long |
serialVersionUID |
DUPLICATE_ZIP_CONTENTS
Constructor and Description |
---|
OnDisk(File file,
java.lang.String originalPath,
java.nio.charset.Charset c) |
Modifier and Type | Method and Description |
---|---|
void |
clearCachedSource() |
java.nio.charset.Charset |
getCharset()
Get the Charset specifying how we're supposed to read the file
in off disk and into UTF-16.
|
java.lang.String |
getCode()
Gets all the code in this source file.
|
com.google.common.io.CharSource |
getCodeCharSource()
Gets a char source for the code in this source file.
|
java.io.Reader |
getCodeReader()
Gets a reader for the code in this source file.
|
void |
setCharset(java.nio.charset.Charset c)
Store the Charset specification as the string version of the name,
rather than the Charset itself.
|
builder, fromCode, fromFile, fromFile, fromFile, fromFile, fromGenerator, fromInputStream, fromInputStream, fromReader, fromZipFile, getCodeNoCache, getColumnOfOffset, getLine, getLineOffset, getLineOfOffset, getName, getNumLines, getOriginalPath, getRegion, hasSourceInMemory, isExtern, setCode, setCode, setIsExtern, setOriginalPath, toString
private static final long serialVersionUID
private final File file
private java.lang.String inputCharset
OnDisk(File file, java.lang.String originalPath, java.nio.charset.Charset c)
public java.lang.String getCode() throws java.io.IOException
SourceFile
getCode
in class SourceFile
java.io.IOException
@GwtIncompatible(value="Files.asCharSource()") public com.google.common.io.CharSource getCodeCharSource()
getCodeCharSource
in class SourceFile
@GwtIncompatible(value="java.io.Reader") public java.io.Reader getCodeReader() throws java.io.IOException
getCodeReader
in class SourceFile
java.io.IOException
public void clearCachedSource()
clearCachedSource
in class SourceFile
public void setCharset(java.nio.charset.Charset c)
c
- charset to use when reading the input.public java.nio.charset.Charset getCharset()