public String getLongFormat(long milliseconds) { return this.getLongFormat(milliseconds, true); } }
@Override public String getComment(final Host host) { Date timestamp = host.getTimestamp(); if(null != timestamp) { // Set comment to timestamp when server was last accessed return UserDateFormatterFactory.get().getLongFormat(timestamp.getTime()); } // There might be files from previous versions that have no timestamp yet. return null; }
public void setMessage(final String message) { final String text; if(StringUtils.isBlank(message)) { // Do not display any progress text when transfer is stopped final Date timestamp = transfer.getTimestamp(); if(null != timestamp) { text = UserDateFormatterFactory.get().getLongFormat(timestamp.getTime(), false); } else { text = StringUtils.EMPTY; } } else { text = message; } messageField.setAttributedStringValue(NSAttributedString.attributedStringWithAttributes( text, TRUNCATE_MIDDLE_ATTRIBUTES)); }
protected void add(final String fullname, final String hostname, final int port, final String user, final String password, final String path) { final Protocol protocol = this.getProtocol(fullname); if(null == protocol) { log.warn(String.format("Unknown service type for %s", fullname)); return; } final Host host = new Host(protocol, hostname, port); host.getCredentials().setUsername(user); host.getCredentials().setPassword(password); if(StringUtils.isNotBlank(path)) { host.setDefaultPath(PathNormalizer.normalize(path)); } host.setComment(UserDateFormatterFactory.get().getLongFormat(new Date().getTime())); this.add(fullname, host); }
this.updateField(modifiedField, UserDateFormatterFactory.get().getLongFormat( file.attributes().getModificationDate()), TRUNCATE_MIDDLE_ATTRIBUTES this.updateField(createdField, UserDateFormatterFactory.get().getLongFormat( file.attributes().getCreationDate()), TRUNCATE_MIDDLE_ATTRIBUTES
if(null != timestamp) { title.appendAttributedString(NSAttributedString.attributedStringWithAttributes( UserDateFormatterFactory.get().getLongFormat(timestamp.getTime()), BundleController.MENU_HELP_FONT_ATTRIBUTES));
UserDateFormatterFactory.get().getLongFormat(item.local.attributes().getModificationDate()), TRUNCATE_MIDDLE_ATTRIBUTES)); UserDateFormatterFactory.get().getLongFormat(status.getRemote().getModificationDate()), TRUNCATE_MIDDLE_ATTRIBUTES));