public static String getFileObjectShortName(FileObject fileObject) {
    StringBuilder sb = new StringBuilder();
    try {
      URI uri = new URI(fileObject.getName().getURI());
      String scheme = fileObject.getName().getScheme();
      sb.append(scheme);
      sb.append("://");
      if (!"file".equals(scheme)) {
        String host = uri.getHost();
        if (host == null)
          host = uri.getAuthority();
        // if host name is not IP, return only host name
        if (host != null && !Pattern.matches("(\\d+\\.){3}\\d+", host)) {
          host = host.split("\\.")[0];
        }
        sb.append(host == null ? "???" : host).append('/');
      }
      sb.append(fileObject.getName().getBaseName());
    } catch (URISyntaxException e) {
      LOGGER.warn("Problem with preparing short name of FileObject: " + e.getMessage());
      sb.setLength(0);
      sb.append(fileObject.getName().getScheme()).append("://").append(fileObject.getName().getBaseName());
    }
    return sb.toString();
  }
Get short name for URL

@param fileObject File object
@return scheme://hostWithoutDomain/fileBaseName
olv-core/src/main/java/pl/otros/logview/api/io/Utils.java