public class ScriptfileUtils
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
ScriptfileUtils.LineEndingStyle
Line ending style
|
Constructor and Description |
---|
ScriptfileUtils() |
Modifier and Type | Method and Description |
---|---|
static java.io.File |
createTempFile(Framework framework)
Create a temp file in the framework
|
static ScriptfileUtils.LineEndingStyle |
lineEndingStyleForNode(INodeEntry node)
Return the line ending style for the node, based on the osFamily, or use LOCAL if
undetermined
|
static void |
setExecutePermissions(java.io.File scriptfile)
Set the executable flag on a file if supported by the OS
|
static void |
writeScriptFile(java.io.InputStream stream,
java.lang.String scriptString,
java.io.Reader reader,
ScriptfileUtils.LineEndingStyle style,
java.io.File scriptfile)
Write script content to a destination file from one of the sources
|
static java.io.File |
writeScriptTempfile(Framework framework,
java.io.File sourcefile)
Deprecated.
|
static java.io.File |
writeScriptTempfile(Framework framework,
java.io.InputStream stream)
Deprecated.
|
static java.io.File |
writeScriptTempfile(Framework framework,
java.io.InputStream stream,
java.lang.String source,
java.io.Reader reader,
ScriptfileUtils.LineEndingStyle style)
Copy a source stream or string content to a tempfile for script execution
|
static java.io.File |
writeScriptTempfile(Framework framework,
java.io.Reader source)
Deprecated.
|
static java.io.File |
writeScriptTempfile(Framework framework,
java.io.Reader source,
ScriptfileUtils.LineEndingStyle style)
Copy reader content to a tempfile for script execution
|
static java.io.File |
writeScriptTempfile(Framework framework,
java.lang.String source)
Deprecated.
|
public static ScriptfileUtils.LineEndingStyle lineEndingStyleForNode(INodeEntry node)
node
- public static java.io.File writeScriptTempfile(Framework framework, java.io.File sourcefile) throws java.io.IOException
framework
- frameworksourcefile
- source filejava.io.IOException
- if an error occurspublic static java.io.File writeScriptTempfile(Framework framework, java.io.InputStream stream) throws java.io.IOException
framework
- frameworkstream
- sourcejava.io.IOException
- if an error occurspublic static java.io.File writeScriptTempfile(Framework framework, java.lang.String source) throws java.io.IOException
framework
- frameworksource
- string contentjava.io.IOException
- if an error occurspublic static java.io.File writeScriptTempfile(Framework framework, java.io.Reader source) throws java.io.IOException
framework
- frameworksource
- string contentjava.io.IOException
- if an error occurspublic static java.io.File writeScriptTempfile(Framework framework, java.io.Reader source, ScriptfileUtils.LineEndingStyle style) throws java.io.IOException
framework
- frameworksource
- string contentjava.io.IOException
- if an error occurspublic static java.io.File writeScriptTempfile(Framework framework, java.io.InputStream stream, java.lang.String source, java.io.Reader reader, ScriptfileUtils.LineEndingStyle style) throws java.io.IOException
framework
- frameworkstream
- source streamsource
- contentstyle
- file line ending style to usereader
- java.io.IOException
- if an error occurspublic static void writeScriptFile(java.io.InputStream stream, java.lang.String scriptString, java.io.Reader reader, ScriptfileUtils.LineEndingStyle style, java.io.File scriptfile) throws java.io.IOException
stream
- stream sourcescriptString
- script contentreader
- reader sourcestyle
- line ending stylescriptfile
- destination filejava.io.IOException
public static java.io.File createTempFile(Framework framework) throws java.io.IOException
java.io.IOException
public static void setExecutePermissions(java.io.File scriptfile) throws java.io.IOException
scriptfile
- target filejava.io.IOException
- if an error occurs