Class DotGroovyFile
java.lang.Object
java.io.File
org.codehaus.gmavenplus.groovyworkarounds.DotGroovyFile
- All Implemented Interfaces:
Serializable
,Comparable<File>
This class exists solely to trick
JavaStubCompilationUnit.addSource(java.io.File)
into letting us use files that don't end in ".groovy" (as a workaround for GROOVY-5021).
- Since:
- 1.0-beta-1
- Author:
- Keegan Witt
- See Also:
-
Field Summary
Fields inherited from class java.io.File
pathSeparator, pathSeparatorChar, separator, separatorChar
-
Constructor Summary
ConstructorDescriptionDotGroovyFile
(File file) A convenience constructor to turn a regular file into a DotGroovyFile.DotGroovyFile
(File parent, String child) Constructs a new DotGroovyFile object with the specified parameters.DotGroovyFile
(String pathname) Constructs a new DotGroovyFile object with the specified parameters.DotGroovyFile
(String parent, String child) Constructs a new DotGroovyFile object with the specified parameters.DotGroovyFile
(URI uri) Constructs a new DotGroovyFile object with the specified parameters. -
Method Summary
Modifier and TypeMethodDescriptiongetName()
A method to lie about the file extension and say it is ".groovy".Gets the script extensions for this Groovy file.setScriptExtensions
(Set<String> newScriptExtensions) Sets the script extensions for this Groovy file.Methods inherited from class java.io.File
canExecute, canRead, canWrite, compareTo, createNewFile, createTempFile, createTempFile, delete, deleteOnExit, equals, exists, getAbsoluteFile, getAbsolutePath, getCanonicalFile, getCanonicalPath, getFreeSpace, getParent, getParentFile, getPath, getTotalSpace, getUsableSpace, hashCode, isAbsolute, isDirectory, isFile, isHidden, lastModified, length, list, list, listFiles, listFiles, listFiles, listRoots, mkdir, mkdirs, renameTo, setExecutable, setExecutable, setLastModified, setReadable, setReadable, setReadOnly, setWritable, setWritable, toPath, toString, toURI, toURL
-
Constructor Details
-
DotGroovyFile
Constructs a new DotGroovyFile object with the specified parameters.- Parameters:
pathname
- Pathname to use to create DotGroovyFile
-
DotGroovyFile
Constructs a new DotGroovyFile object with the specified parameters.- Parameters:
parent
- Parent pathname to use to create DotGroovyFilechild
- Child pathname to use to create DotGroovyFile
-
DotGroovyFile
Constructs a new DotGroovyFile object with the specified parameters.- Parameters:
parent
- Parent file to use to create DotGroovyFilechild
- Child pathname to use to create DotGroovyFile
-
DotGroovyFile
Constructs a new DotGroovyFile object with the specified parameters.- Parameters:
uri
- URI to use to create DotGroovyFile
-
DotGroovyFile
A convenience constructor to turn a regular file into a DotGroovyFile.- Parameters:
file
- File to use to create DotGroovyFile
-
-
Method Details
-
getName
A method to lie about the file extension and say it is ".groovy". -
getScriptExtensions
Gets the script extensions for this Groovy file.- Returns:
- The script extensions for this Groovy file
-
setScriptExtensions
Sets the script extensions for this Groovy file.- Parameters:
newScriptExtensions
- The script extensions to set on this Groovy file- Returns:
- This object (for fluent invocation)
-