org.millscript.millscript.functions
Class CopyToOutputFunction

java.lang.Object
  extended by org.millscript.millscript.functions.Function
      extended by org.millscript.millscript.functions.AbstractOutputFunction
          extended by org.millscript.millscript.functions.CopyToOutputFunction

public final class CopyToOutputFunction
extends AbstractOutputFunction

This class implements the MillScript copyToOutput function. This function copies a static resource from the inventory to the current output folder. Static resources are stored in the inventory as a directory with an extension of dir.


Field Summary
 
Fields inherited from class org.millscript.millscript.functions.AbstractOutputFunction
config
 
Constructor Summary
CopyToOutputFunction(Package pack)
          Constructs a new copyToOutput function.
 
Method Summary
 void apply(Machine mc, int nargs)
          Performs this function using the specified machine, with the specified number of arguments.
 void copyFile(org.millscript.commons.vfs.VFile source, org.millscript.commons.vfs.VFile destination)
          Copies the specified source file to the destination.
 
Methods inherited from class org.millscript.millscript.functions.AbstractOutputFunction
getCurrentWorkingFolder, getCurrentWorkingFolderList, getWorkingFolder, makeCurrentWorkingFolder
 
Methods inherited from class org.millscript.millscript.functions.Function
applyUpdater, checkNargs, checkNargsGT, checkUNargs, getName, modName, reportNargsError, reportNargsGTError, setName, toString, tryClone
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CopyToOutputFunction

public CopyToOutputFunction(Package pack)
Constructs a new copyToOutput function.

Parameters:
pack - the package this function belongs to
Method Detail

apply

public void apply(Machine mc,
                  int nargs)
Description copied from class: Function
Performs this function using the specified machine, with the specified number of arguments.

Specified by:
apply in class Function
Parameters:
mc - the machine to perform this function on
nargs - the number of arguments the function is being invoked with
See Also:
Function.apply(org.millscript.millscript.vm.Machine, int)

copyFile

public void copyFile(org.millscript.commons.vfs.VFile source,
                     org.millscript.commons.vfs.VFile destination)
              throws java.io.IOException
Copies the specified source file to the destination.

Parameters:
source - the source file
destination - the destination file
Throws:
java.io.IOException - thrown if there is a problem reading from the source or writing to the destination


Copyright © 2001-2007 Open World Ltd. All Rights Reserved.