public class ScriptSource extends java.lang.Object implements java.lang.Comparable<ScriptSource>
Constructor and Description |
---|
ScriptSource(java.io.File file)
Constructor.
|
ScriptSource(java.lang.String content)
Constructor.
|
ScriptSource(java.lang.String content,
java.lang.String name)
Constructor.
|
ScriptSource(java.net.URL url)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(ScriptSource source)
Compares this ScriptSource with another ScriptSource.
|
static ScriptSource |
create(java.io.File file)
Create a ScriptSource with a File.
|
static ScriptSource |
create(java.lang.String name)
Create a ScriptSource with a name and a null content.
|
static ScriptSource |
create(java.net.URL url)
Create a ScriptSource with an URL.
|
boolean |
equals(java.lang.Object obj) |
java.lang.String |
getAbsolutePath()
Return the absolute path of the source.
|
java.io.BufferedReader |
getBufferedReader()
Return a BufferedReader on the source.
|
java.io.File |
getFile()
Return the File content of the source.
|
java.lang.String |
getFileName()
Return the name of the source.
|
java.lang.String |
getFileNameBody()
Return the body name of the source (before the extension if there is an extension, else this is the name of the file itself).
|
java.lang.String |
getPath()
Return the path of the source.
|
java.lang.String |
getScriptContent()
Return the String content of the source.
|
java.net.URL |
getURL()
Return the URL content of the source.
|
int |
hashCode() |
boolean |
isFile()
Return true for a file source.
|
void |
setScriptContent(java.lang.String content)
Return the String content of the source.
|
public ScriptSource(java.net.URL url)
url
- the script URLpublic ScriptSource(java.io.File file)
file
- the script filepublic ScriptSource(java.lang.String content)
content
- the script text contentpublic ScriptSource(java.lang.String content, java.lang.String name)
content
- the script text contentname
- the script namepublic static final ScriptSource create(java.lang.String name)
name
- the ScriptSource namepublic static final ScriptSource create(java.net.URL url)
url
- the ScriptSource urlpublic static final ScriptSource create(java.io.File file)
file
- the ScriptSource Filepublic java.io.File getFile()
public java.net.URL getURL()
public java.lang.String getAbsolutePath()
public java.lang.String getPath()
public void setScriptContent(java.lang.String content)
isFile()
returens true.content
- the String content of the sourcepublic java.lang.String getScriptContent()
public boolean isFile()
public java.lang.String getFileName()
public java.lang.String getFileNameBody()
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int compareTo(ScriptSource source)
compareTo
in interface java.lang.Comparable<ScriptSource>
source
- the ScriptSource to be compared.public java.io.BufferedReader getBufferedReader() throws java.io.IOException
java.io.IOException
Copyright © 2019-2024 Herve Girod. All Rights Reserved. Documentation and source under the BSD licence