org.openide.filesystems.FileUtil.getMIMETypeExtensions()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(1.7k)|赞(0)|评价(0)|浏览(119)

本文整理了Java中org.openide.filesystems.FileUtil.getMIMETypeExtensions()方法的一些代码示例,展示了FileUtil.getMIMETypeExtensions()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。FileUtil.getMIMETypeExtensions()方法的具体详情如下:
包路径:org.openide.filesystems.FileUtil
类名称:FileUtil
方法名:getMIMETypeExtensions

FileUtil.getMIMETypeExtensions介绍

[英]Returns list of file extensions associated with specified MIME type. In other words files with those extensions are recognized as specified MIME type in NetBeans' filesystem. It never returns null.
[中]返回与指定MIME类型关联的文件扩展名列表。换句话说,具有这些扩展名的文件在NetBeans的文件系统中被识别为指定的MIME类型。它从不返回null。

代码示例

代码示例来源:origin: org.netbeans.api/org-openide-filesystems

/**
 * Add all extensions assigned to a MIME Type to the extension list.
 */
private static void addMimeTypeExts(List<FilterElement> exts, String type) {
  addAllExtensionsToList(exts, FileUtil.getMIMETypeExtensions(type));
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-cnd-utils

private MIMEExtensions(String mimeType, String description) {
  this.mimeType = mimeType;
  this.description = description;
  exts = new TreeSet<String>();
  exts.addAll(FileUtil.getMIMETypeExtensions(mimeType));
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-css-prep

public Collection<String> getFileExtensions() {
  Set<String> extensions = new HashSet<>();
  for (String mimeType : getMimeTypes()) {
    extensions.addAll(FileUtil.getMIMETypeExtensions(mimeType));
  }
  return extensions;
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-cnd-utils

public static boolean isRegistered(String mimeType, String ext) {
  if (ext == null || ext.length() == 0) {
    return false;
  }
  // try cache
  MIMEExtensions out = get(mimeType);
  if (out == null) {
    return FileUtil.getMIMETypeExtensions(mimeType).contains(ext);
  } else {
    return out.contains(ext);
  }
}
/**

相关文章