public JavaScriptLibrary getJavaScriptLibrary(final String name) {
if (DominoUtils.isUnid(name)) {
Document doc = database_.getDocumentByUNID(name);
return new JavaScriptLibrary(doc);
} else {
NoteCollection notes = getNoteCollection(
String.format(" @Contains($Flags; 'j') & @Explode($TITLE; '|')=\"%s\" ", DominoUtils.escapeForFormulaString(name)),
EnumSet.of(SelectOption.SCRIPT_LIBRARIES));
String noteId = notes.getFirstNoteID();
if (!noteId.isEmpty()) {
Document doc = database_.getDocumentByID(noteId);
return new JavaScriptLibrary(doc);
}
}