congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
org.apache.james.imap.api.display
Code IndexAdd Tabnine to your IDE (free)

How to use org.apache.james.imap.api.display

Best Java code snippets using org.apache.james.imap.api.display (Showing top 20 results out of 315)

origin: org.apache.james/apache-james-imap-api

public static final HumanReadableText unseen(long numberUnseen) {
  return new HumanReadableText("org.apache.james.imap.UNSEEN", "Message " + numberUnseen + " is first unseen");
}
origin: org.apache.james/apache-james-imap-message

private String asString(HumanReadableText text, ImapSession session) {
  // TODO: calculate locales
  return localizer.localize(text, new Locales(new ArrayList<Locale>(), null));
}
origin: org.apache.james.protocols/protocols-imap

@Override
public String localize(HumanReadableText text, Locales locales) {
  
  String result;
  if (text == null) {
    result = null;
  } else {
    //FIXME implement the locale selection
    final Locale chosenLocale = Locale.US;
    //FIXME implement the localized value lookup depending on chosenLocale
    result = text.getDefaultValue();
    
    Object[] params = text.getParameters();
    if (params != null && params.length > 0) {
      MessageFormat messageFormat = new MessageFormat(result, chosenLocale);
      result = messageFormat.format(params);
    }
  }
  return result;
}
origin: org.apache.james/apache-james-imap-message

/**
 * 
 * Reads the mailbox name via {@link #mailboxUTF7()} but also decode it via {@link CharsetUtil#decodeModifiedUTF7(String)}
 * 
 * If you really want to get the modified UTF7 version you should use {@link #mailboxUTF7()}
 * 
 * @return decodedMailbox
 * 
 */
public String mailbox() throws DecodingException {
  return CharsetUtil.decodeModifiedUTF7(mailboxUTF7());
}
origin: org.apache.james.protocols/protocols-imap

private ImapMessage unsupportedCharset(String tag, ImapCommand command) {
  final StatusResponseFactory factory = getStatusResponseFactory();
  final ResponseCode badCharset = StatusResponse.ResponseCode.badCharset(CharsetUtil.getAvailableCharsetNames());
  return factory.taggedNo(tag, command, HumanReadableText.BAD_CHARSET, badCharset);
}
origin: org.apache.james.protocols/protocols-imap

@Override
public ImapResponseComposer mailbox(String mailboxName) throws IOException {
  quote(CharsetUtil.encodeModifiedUTF7(mailboxName));
  return this;
}
origin: org.apache.james/apache-james-imap-processor

protected void permanentFlags(Responder responder, MessageManager.MetaData metaData, SelectedMailbox selected) {
  final Flags permanentFlags = metaData.getPermanentFlags();
  if (permanentFlags.contains(Flags.Flag.USER)) {
    permanentFlags.add(selected.getApplicableFlags());
  }
  final StatusResponse untaggedOk = factory.untaggedOk(HumanReadableText.permanentFlags(permanentFlags), ResponseCode.permanentFlags(permanentFlags));
  responder.respond(untaggedOk);
}

origin: org.apache.james/apache-james-imap-processor

private void handleResponseException(final ImapProcessor.Responder responder, MailboxException e, final HumanReadableText message, ImapSession session) {
  session.getLog().info(message.toString());
  session.getLog().debug(message.toString(), e);
  // TODO: consider whether error message should be passed to the user
  final StatusResponse response = factory.untaggedNo(message);
  responder.respond(response);
}
origin: org.apache.james.protocols/protocols-imap

private String asString(HumanReadableText text, ImapSession session) {
  // TODO: calculate locales
  return localizer.localize(text, new Locales(new ArrayList<>(), null));
}
origin: org.apache.james.protocols/protocols-imap

public static final HumanReadableText unseen(long numberUnseen) {
  return new HumanReadableText("org.apache.james.imap.UNSEEN", "MailboxMessage " + numberUnseen + " is first unseen");
}
origin: org.apache.james/apache-james-imap-message

/**
 * @see Localizer#localize(HumanReadableText, Locales)
 */
public String localize(HumanReadableText text, Locales locales) {
  
  String result;
  if (text == null) {
    result = null;
  } else {
    //FIXME implement the locale selection
    final Locale chosenLocale = Locale.US;
    //FIXME implement the localized value lookup depending on chosenLocale
    result = text.getDefaultValue();
    
    Object[] params = text.getParameters();
    if (params != null && params.length > 0) {
      MessageFormat messageFormat = new MessageFormat(result, chosenLocale);
      result = messageFormat.format(params);
    }
  }
  return result;
}
origin: org.apache.james.protocols/protocols-imap

/**
 * 
 * Reads the mailbox name via {@link #mailboxUTF7()} but also decode it via {@link CharsetUtil#decodeModifiedUTF7(String)}
 * 
 * If you really want to get the modified UTF7 version you should use {@link #mailboxUTF7()}
 * 
 * @return decodedMailbox
 * 
 */
public String mailbox() throws DecodingException {
  return CharsetUtil.decodeModifiedUTF7(mailboxUTF7());
}
origin: org.apache.james/apache-james-imap-message

private ImapMessage unsupportedCharset(final String tag, final ImapCommand command) {
  final StatusResponseFactory factory = getStatusResponseFactory();
  final ResponseCode badCharset = StatusResponse.ResponseCode.badCharset(CharsetUtil.getAvailableCharsetNames());
  final StatusResponse result = factory.taggedNo(tag, command, HumanReadableText.BAD_CHARSET, badCharset);
  return result;
}
origin: org.apache.james/apache-james-imap-message

/**
 * @see org.apache.james.imap.encode.ImapResponseComposer#mailbox(java.lang.String)
 */
public ImapResponseComposer mailbox(final String mailboxName) throws IOException {
  quote(CharsetUtil.encodeModifiedUTF7(mailboxName));
  return this;
}
origin: org.apache.james.protocols/protocols-imap

protected void permanentFlags(Responder responder, MessageManager.MetaData metaData, SelectedMailbox selected) {
  final Flags permanentFlags = metaData.getPermanentFlags();
  if (permanentFlags.contains(Flags.Flag.USER)) {
    permanentFlags.add(selected.getApplicableFlags());
  }
  final StatusResponse untaggedOk = factory.untaggedOk(HumanReadableText.permanentFlags(permanentFlags), ResponseCode.permanentFlags(permanentFlags));
  responder.respond(untaggedOk);
}

origin: org.apache.james.protocols/protocols-imap

private String asString(HumanReadableText text, ImapSession session) {
  // TODO: calculate locales
  return localizer.localize(text, new Locales(new ArrayList<>(), null));
}
origin: org.apache.james.protocols/protocols-imap

public static final HumanReadableText permanentFlags(Flags flags) {
  String text;
  if (flags.getSystemFlags() != null && flags.getSystemFlags().length > 0) {
    text = "Limited";
  } else {
    text = "No permanent flags permitted";
  }
  return new HumanReadableText("org.apache.james.imap.PERMANENT_FLAGS", text);
}
origin: org.apache.james/apache-james-imap-message

private String asString(HumanReadableText text, ImapSession session) {
  // TODO: calculate locales
  return localizer.localize(text, new Locales(new ArrayList<Locale>(), null));
}
origin: org.apache.james/apache-james-imap-api

public static final HumanReadableText permanentFlags(Flags flags) {
  String text;
  if (flags.getSystemFlags() != null && flags.getSystemFlags().length > 0) {
    text = "Limited";
  } else {
    text = "No permanent flags permitted";
  }
  return new HumanReadableText("org.apache.james.imap.PERMANENT_FLAGS", text);
}
origin: org.apache.james.protocols/protocols-imap

@Override
protected void doProcess(SetQuotaRequest message, ImapSession session, String tag, ImapCommand command, Responder responder) {
  Object[] params = new Object[]{
    "Full admin rights",
    command.getName(),
    "Can not perform SETQUOTA commands"
  };
  HumanReadableText humanReadableText = new HumanReadableText(HumanReadableText.UNSUFFICIENT_RIGHTS_KEY, HumanReadableText.UNSUFFICIENT_RIGHTS_DEFAULT_VALUE, params);
  no(command, tag, responder, humanReadableText);
}
org.apache.james.imap.api.display

Most used classes

  • HumanReadableText
    Keys human response text that may be displayed to the user.
  • CharsetUtil
    Utility class which can be used to get a list of supported Charset's Beside this it has some methods
  • Locales
    Immutable bean describing localisation preferences. Two separate sources of information about loc
  • Localizer
    Localizes text for display.
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now