Package daikon.split
Class FileCompiler
- Object
-
- FileCompiler
-
public final class FileCompiler extends Object
This class has methodcompileFiles(List)
that compiles Java source files. It invokes a user-specified external command, such asjavac
orjikes
.
-
-
Constructor Summary
Constructors Constructor Description FileCompiler(String @MinLen(1) [] compiler, @org.checkerframework.checker.index.qual.Positive long timeLimit)
Creates a new FileCompiler.FileCompiler(String compiler, @org.checkerframework.checker.index.qual.Positive long timeLimit)
Creates a new FileCompiler.FileCompiler(ArrayList<String> compiler, @org.checkerframework.checker.index.qual.Positive long timeLimit)
Creates a new FileCompiler.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
compileFiles(List<String> fileNames)
Compiles the files given by fileNames.
-
-
-
Constructor Detail
-
FileCompiler
public FileCompiler(String @MinLen(1) [] compiler, @org.checkerframework.checker.index.qual.Positive long timeLimit)
Creates a new FileCompiler. Compared toFileCompiler(String,long)
, this constructor permits spaces and other special characters in the command and arguments.- Parameters:
compiler
- an array of Strings representing a command that runs a Java compiler (it could be the full path name or whatever is used on the commandline), plus any command-line optionstimeLimit
- the maximum permitted compilation time, in msec
-
FileCompiler
public FileCompiler(ArrayList<String> compiler, @org.checkerframework.checker.index.qual.Positive long timeLimit)
Creates a new FileCompiler. Compared toFileCompiler(String,long)
, this constructor permits spaces and other special characters in the command and arguments.- Parameters:
compiler
- a list of Strings representing a command that runs a Java compiler (it could be the full path name or whatever is used on the commandline), plus any command-line optionstimeLimit
- the maximum permitted compilation time, in msec
-
FileCompiler
public FileCompiler(String compiler, @org.checkerframework.checker.index.qual.Positive long timeLimit)
Creates a new FileCompiler.- Parameters:
compiler
- a command that runs a Java compiler; for instance, it could be the full path name or whatever is used on the commandline. It may contain command-line arguments, and is split on spaces.timeLimit
- the maximum permitted compilation time, in msec
-
-
Method Detail
-
compileFiles
public String compileFiles(List<String> fileNames) throws IOException
Compiles the files given by fileNames. Returns the error output.- Parameters:
fileNames
- paths to the files to be compiled as Strings- Returns:
- the error output from compiling the files
- Throws:
IOException
- if there is a problem reading a file
-
-