Thank you for the direction.
I couldn't get okmfolder.createsimple to work, but I found an example for okmfolder.getinstance.createsimple that works. Here's the whole thing in case it helps someone else; it worked for me:
Code: Select allimport java.io.FileReader;
import java.io.Reader;
import java.util.Iterator;
import java.util.List;
import java.util.Collection;
import com.googlecode.jcsv.CSVStrategy;
import com.googlecode.jcsv.reader.CSVReader;
import com.googlecode.jcsv.reader.internal.CSVReaderBuilder;
import com.googlecode.jcsv.reader.internal.DefaultCSVEntryParser;
import com.openkm.api.OKMFolder;
String grpName = "okg:metadata";
String FILE_LOG_NAME = "CSVLOG";
String META_PATH = "C:\\Users\\Root\\importfolder\\";
String META_FILE_NAME = "qbvendorlist.csv";
int uniqueFileName = 0;
int valueColumn = 1;
// Format defintion
char delimiter = ',';
char quoteCharacter = '"';
char commentIndicator = '#';
boolean skipHeader = true;
boolean ignoreEmptyLines = true;
CSVStrategy strategy = new CSVStrategy(delimiter, quoteCharacter, commentIndicator, skipHeader, ignoreEmptyLines);
// File reader
Reader reader = new FileReader(META_PATH + META_FILE_NAME);
// CSV reader
CSVReader csvParser = new CSVReaderBuilder(reader).strategy(strategy).entryParser(new DefaultCSVEntryParser()).build();
List data = csvParser.readAll();
int count = 1;
int countFound = 0;
int countNotDocument = 0;
int moreThanOneDocumentFound = 0;
int notFound = 0;
int noName = 0;
for (Iterator it = data.listIterator(); it.hasNext();) {
String[] row = (String[]) it.next();
String docPath = row[uniqueFileName];
print(count + ">>>> " + docPath);
if (docPath != null && !docPath.equals("")) {
OKMFolder.getInstance().createSimple(null,"/okm:root/Vendors/" + docPath);
} else {
print("error document has no name");
noName++;
}
print("</br>");
//FileLogger.info(FILE_LOG_NAME, "Document name ''{0}'' to ''{1}''", row[0], row[posDocRevNo]);
count++;
}
print("Total:" + count + "</br>");
print("Found:" + countFound + "</br>");
print("Error not document:" + countNotDocument + "</br>");
print("Error more then one document found:" + moreThanOneDocumentFound + "</br>");
print("Error not found:" + notFound + "</br>");
print("Error name empty:" + notFound + "</br>");