}
public void process() throws dbXMLException {
CollectionClient col = (CollectionClient)cl.getProperty(CommandLine.COLLECTION);
if ( col == null )
throw new dbXMLException("Collection context required");
boolean binary = col.getCollectionType() == CollectionClient.TYPE_VALUES;
String type;
if ( binary )
type = "Record";
else
type = "Document";
String filename = cl.getNextToken(type+" Name");
File file = new File(filename);
String docName = file.getName();
boolean asUsed = false;
while ( cl.hasMoreTokens() ) {
String adj = cl.getNextToken("As");
if ( adj.equalsIgnoreCase("AS") ) {
asUsed = true;
if ( cl.hasMoreTokens() )
docName = cl.getNextToken("Filename");
else
throw new dbXMLException(type + " name required");
}
}
File dir = file.getParentFile();
if ( dir == null )
dir = new File("./");
String fName = file.getName();
if ( fName.indexOf('?') != -1 || fName.indexOf('*') != -1 ) {
// Wildcard specified
if ( asUsed )
throw new dbXMLException("Can't assign a " + type + " name to a wildcard path");
List files = new ArrayList();
PrintWriter pw = cl.getWriter();
addFiles(files, col, fName);
int fileCount = files.size();