try {
createLibraryType = SupportedLibraryType.valueOf(libraryType);
SupportedLibraryType.valueOf(libraryType);
} catch (IllegalArgumentException ex) {
String exceptionMsg = String.format(Messages.INVALID_LIB_TYPE_MESSAGE, libraryType, StringUtils.join(SupportedLibraryType.values(), ", ") );
throw new CommandArgumentsException(exceptionMsg, this);
}
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);
}