}
App app = brjs.app(appName);
if(!app.dirExists()) throw new NodeDoesNotExistException(app, this);
JsLib library = app.appJsLib(libraryName);
if (library.dirExists()) throw new NodeAlreadyExistsException(library, this);
switch ( createLibraryType ) {
case br:
break;
case thirdparty:
createThirdpartyManifest(library);
break;
}
try {
library.populate();
}
catch(InvalidNameException e) {
throw new CommandArgumentsException(e, this);
}
catch(ModelUpdateException e) {
throw new CommandOperationException("Cannot create library '" + library.dir().getPath() + "'", e);
}
logger.println(Messages.LIBRARY_CREATE_SUCCESS_CONSOLE_MSG, libraryName);
logger.println(Messages.LIBRARY_PATH_CONSOLE_MSG, library.dir().getPath());
return 0;
}