| | |
| | | argParser.setUsageArgument(showUsage, getOutputStream()); |
| | | } catch (final ArgumentException ae) { |
| | | final LocalizableMessage message = ERR_CANNOT_INITIALIZE_ARGS.get(ae.getMessage()); |
| | | println(message); |
| | | errPrintln(message); |
| | | return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue(); |
| | | } |
| | | |
| | |
| | | } |
| | | } catch (final ArgumentException ae) { |
| | | final LocalizableMessage message = ERR_ERROR_PARSING_ARGS.get(ae.getMessage()); |
| | | println(message); |
| | | errPrintln(message); |
| | | return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue(); |
| | | } |
| | | |
| | |
| | | try { |
| | | filters.add(Filter.valueOf(filterString)); |
| | | } catch (final LocalizedIllegalArgumentException e) { |
| | | println(e.getMessageObject()); |
| | | errPrintln(e.getMessageObject()); |
| | | return ResultCode.CLIENT_SIDE_FILTER_ERROR.intValue(); |
| | | } |
| | | } |
| | |
| | | filters.add(ldapFilter); |
| | | } |
| | | } catch (final LocalizedIllegalArgumentException e) { |
| | | println(e.getMessageObject()); |
| | | errPrintln(e.getMessageObject()); |
| | | return ResultCode.CLIENT_SIDE_FILTER_ERROR.intValue(); |
| | | } catch (final IOException e) { |
| | | println(LocalizableMessage.raw(e.toString())); |
| | | errPrintln(LocalizableMessage.raw(e.toString())); |
| | | return ResultCode.CLIENT_SIDE_FILTER_ERROR.intValue(); |
| | | } finally { |
| | | closeIfNotNull(in); |
| | |
| | | } |
| | | |
| | | if (filters.isEmpty()) { |
| | | println(ERR_SEARCH_NO_FILTERS.get()); |
| | | println(argParser.getUsageMessage()); |
| | | errPrintln(ERR_SEARCH_NO_FILTERS.get()); |
| | | errPrintln(argParser.getUsageMessage()); |
| | | return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue(); |
| | | } |
| | | |
| | |
| | | typesOnly.isPresent()).setTimeLimit(timeLimit.getIntValue()) |
| | | .setSizeLimit(sizeLimit.getIntValue()); |
| | | } catch (final ArgumentException e) { |
| | | println(e.getMessageObject()); |
| | | errPrintln(e.getMessageObject()); |
| | | return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue(); |
| | | } catch (final LocalizedIllegalArgumentException e) { |
| | | println(e.getMessageObject()); |
| | | errPrintln(e.getMessageObject()); |
| | | return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue(); |
| | | } |
| | | |
| | |
| | | final LocalizableMessage message = |
| | | ERR_LDIF_FILE_CANNOT_OPEN_FOR_READ.get(trailingArguments.get(0), e |
| | | .getLocalizedMessage()); |
| | | println(message); |
| | | errPrintln(message); |
| | | return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue(); |
| | | } |
| | | } |
| | |
| | | final LocalizableMessage message = |
| | | ERR_LDIF_FILE_CANNOT_OPEN_FOR_WRITE.get(outputFilename.getValue(), e |
| | | .getLocalizedMessage()); |
| | | println(message); |
| | | errPrintln(message); |
| | | return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue(); |
| | | } |
| | | } |
| | |
| | | LDIF.copyTo(LDIF.search(sourceReader, search), outputWriter); |
| | | } catch (final IOException e) { |
| | | if (e instanceof LocalizableException) { |
| | | println(ERR_LDIFSEARCH_FAILED.get(((LocalizableException) e).getMessageObject())); |
| | | errPrintln(ERR_LDIFSEARCH_FAILED.get(((LocalizableException) e).getMessageObject())); |
| | | } else { |
| | | println(ERR_LDIFSEARCH_FAILED.get(e.getLocalizedMessage())); |
| | | errPrintln(ERR_LDIFSEARCH_FAILED.get(e.getLocalizedMessage())); |
| | | } |
| | | return ResultCode.CLIENT_SIDE_LOCAL_ERROR.intValue(); |
| | | } finally { |