public class Utils extends Object
| Constructor and Description |
|---|
Utils() |
| Modifier and Type | Method and Description |
|---|---|
static void |
CopyFile(File inputFile,
File outputFile)
Copies a file.
|
static void |
CopyFile(File inputFile,
File outputFile,
String resourceName)
Copy a file with a fall back resource.
|
static void |
CopyReaderToFile(Reader reader,
File outputFile)
Copies a Reader into a file.
|
static void |
copyStaticRootDirectoryFiles(File outputDirectory,
File stylesheet,
File sourceStylesheet)
Copy required static files into the root output directory.
|
static void |
copyStaticSourceDirectoryFiles(File outputDirectory,
String relativePath)
Copies required static files into the source code directory.
|
static void |
CopyStreamToFile(InputStream inputStream,
File outputFile)
Copies a InputStream into a file.
|
static InputStream |
getBOMInputStream(InputStream inputStream,
String inputEncoding)
Return an InputStream, stripping out any BOM if the specified or default character encoding is UTF*.
|
static String |
getStringFromInputStream(InputStream inputStream)
Aggregate contents of an InputStream into a String
|
public static void CopyFile(File inputFile, File outputFile, String resourceName) throws FileNotFoundException, IOException
inputFile - sourceoutputFile - targetresourceName - - internal resource to use if inputFile does not existFileNotFoundException - if the file does not existIOException - on input errorpublic static void CopyFile(File inputFile, File outputFile) throws FileNotFoundException, IOException
inputFile - sourceoutputFile - targetFileNotFoundException - if the file does not existIOException - on input errorpublic static void CopyStreamToFile(InputStream inputStream, File outputFile) throws FileNotFoundException, IOException
inputStream - sourceoutputFile - targetFileNotFoundException - if the file does not existIOException - on input errorpublic static void CopyReaderToFile(Reader reader, File outputFile) throws FileNotFoundException, IOException
reader - sourceoutputFile - targetFileNotFoundException - if the file does not existIOException - on input errorpublic static String getStringFromInputStream(InputStream inputStream) throws IOException
inputStream - sourceIOException - on input errorpublic static void copyStaticSourceDirectoryFiles(File outputDirectory, String relativePath) throws Exception
outputDirectory - directory to copy filesrelativePath - the relative path to the location of the root output directoryException - on read or write errorpublic static void copyStaticRootDirectoryFiles(File outputDirectory, File stylesheet, File sourceStylesheet) throws Exception
outputDirectory - directory to copy filesstylesheet - explicit PLDoc CSS stylesheetsourceStylesheet - explicit scraped source code CSS stylesheetException - on read or write errorpublic static InputStream getBOMInputStream(InputStream inputStream, String inputEncoding) throws IOException
inputStream - Stream that may or may not contain a BOMinputEncoding - file encodingIOException - on input errorCopyright © 2019. All rights reserved.