Tabnine Logo
AbstractUserDateFormatter.getShortFormat
Code IndexAdd Tabnine to your IDE (free)

How to use
getShortFormat
method
in
ch.cyberduck.core.date.AbstractUserDateFormatter

Best Java code snippets using ch.cyberduck.core.date.AbstractUserDateFormatter.getShortFormat (Showing top 9 results out of 315)

origin: iterate-ch/cyberduck

public String getShortFormat(long milliseconds) {
  return this.getShortFormat(milliseconds, true);
}
origin: iterate-ch/cyberduck

@Override
public NSView getAccessoryView(final NSAlert alert) {
  final NSView view = super.getAccessoryView(alert);
  String proposal = MessageFormat.format(PreferencesFactory.get().getProperty("browser.duplicate.format"),
      FilenameUtils.getBaseName(selected.getName()),
      UserDateFormatterFactory.get().getShortFormat(System.currentTimeMillis(), false).replace(Path.DELIMITER, ':'),
      StringUtils.isNotBlank(selected.getExtension()) ? String.format(".%s", selected.getExtension()) : StringUtils.EMPTY);
  this.updateField(inputField, proposal);
  return view;
}
origin: iterate-ch/cyberduck

    MessageFormat.format(LocaleFactory.localizedString("{0} URL"), LocaleFactory.localizedString("Pre-Signed", "S3"))
        + " (" + MessageFormat.format(LocaleFactory.localizedString("Expires {0}", "S3") + ")",
        UserDateFormatterFactory.get().getShortFormat(expiry * 1000))
));
origin: iterate-ch/cyberduck

  @Override
  public DescriptiveUrl toUploadUrl(final Path file, final CreateUploadShareRequest options, final PasswordCallback callback) throws BackgroundException {
    try {
      final UploadShare share = new SharesApi(session.getClient()).createUploadShare(
        options.targetId(Long.parseLong(nodeid.getFileid(file, new DisabledListProgressListener()))), StringUtils.EMPTY, null);
      final String help;
      if(null == share.getExpireAt()) {
        help = MessageFormat.format(LocaleFactory.localizedString("{0} URL"), LocaleFactory.localizedString("Pre-Signed", "S3"));
      }
      else {
        final long expiry = share.getExpireAt().getMillis();
        help = MessageFormat.format(LocaleFactory.localizedString("{0} URL"), LocaleFactory.localizedString("Pre-Signed", "S3")) + " (" + MessageFormat.format(LocaleFactory.localizedString("Expires {0}", "S3") + ")",
          UserDateFormatterFactory.get().getShortFormat(expiry * 1000)
        );
      }
      return new DescriptiveUrl(
        URI.create(String.format("%s://%s/#/public/shares-uploads/%s",
          session.getHost().getProtocol().getScheme(),
          session.getHost().getHostname(),
          share.getAccessKey())
        ),
        DescriptiveUrl.Type.signed, help);
    }
    catch(ApiException e) {
      throw new SDSExceptionMappingService().map(e);
    }
  }
}
origin: iterate-ch/cyberduck

private DescriptiveUrl createSignedUrl(final Path file, int seconds) {
  final CloudBlob blob;
  try {
    if(!session.isConnected()) {
      return DescriptiveUrl.EMPTY;
    }
    blob = session.getClient().getContainerReference(containerService.getContainer(file).getName())
        .getBlobReferenceFromServer(containerService.getKey(file));
  }
  catch(URISyntaxException | StorageException e) {
    return DescriptiveUrl.EMPTY;
  }
  final String token;
  try {
    token = blob.generateSharedAccessSignature(this.getPolicy(seconds), null);
  }
  catch(InvalidKeyException | StorageException e) {
    return DescriptiveUrl.EMPTY;
  }
  return new DescriptiveUrl(URI.create(String.format("%s://%s%s?%s",
      Scheme.https.name(), session.getHost().getHostname(), URIEncoder.encode(file.getAbsolute()), token)),
      DescriptiveUrl.Type.signed,
      MessageFormat.format(LocaleFactory.localizedString("{0} URL"), LocaleFactory.localizedString("Pre-Signed", "S3"))
          + " (" + MessageFormat.format(LocaleFactory.localizedString("Expires {0}", "S3") + ")",
          UserDateFormatterFactory.get().getShortFormat(this.getExpiry(seconds))));
}
origin: iterate-ch/cyberduck

dateFormatter.getShortFormat(item.attributes().getModificationDate(),
  preferences.getBoolean("browser.date.natural")),
TableCellAttributes.browserFontLeftAlignment()
origin: iterate-ch/cyberduck

try {
  listener.message(MessageFormat.format(LocaleFactory.localizedString("Changing timestamp of {0} to {1}", "Status"),
    file.getName(), UserDateFormatterFactory.get().getShortFormat(status.getTimestamp())));
  feature.setTimestamp(file, status.getTimestamp());
origin: iterate-ch/cyberduck

if(timestamp != null) {
  listener.message(MessageFormat.format(LocaleFactory.localizedString("Changing timestamp of {0} to {1}", "Status"),
      file.getName(), UserDateFormatterFactory.get().getShortFormat(status.getTimestamp())));
  try {
    timestamp.setTimestamp(file, status.getTimestamp());
origin: iterate-ch/cyberduck

final long expiry = share.getExpireAt().getMillis();
help = MessageFormat.format(LocaleFactory.localizedString("{0} URL"), LocaleFactory.localizedString("Pre-Signed", "S3")) + " (" + MessageFormat.format(LocaleFactory.localizedString("Expires {0}", "S3") + ")",
  UserDateFormatterFactory.get().getShortFormat(expiry * 1000)
);
ch.cyberduck.core.dateAbstractUserDateFormattergetShortFormat

Popular methods of AbstractUserDateFormatter

  • getMediumFormat
  • getLongFormat

Popular in Java

  • Making http requests using okhttp
  • getApplicationContext (Context)
  • compareTo (BigDecimal)
  • requestLocationUpdates (LocationManager)
  • BufferedReader (java.io)
    Wraps an existing Reader and buffers the input. Expensive interaction with the underlying reader is
  • System (java.lang)
    Provides access to system-related information and resources including standard input and output. Ena
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
  • Top Vim plugins
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