millisToCalendar(System.currentTimeMillis()), context.getUsername(), properties);
// check the name
String name = getStringProperty(properties, PropertyIds.NAME);
if (!isValidName(name)) {
throw new CmisNameConstraintViolationException("Name is not valid!");
}
// get parent File
File parent = getFile(folderId);
if (!parent.isDirectory()) {
throw new CmisObjectNotFoundException("Parent is not a folder!");
}
// check the file
File newFile = new File(parent, name);
if (newFile.exists()) {
throw new CmisNameConstraintViolationException("Document already exists!");
}
// create the file
try {
newFile.createNewFile();