com.twelvemonkeys.io.FileUtil.getExtension()方法的使用及代码示例

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

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

FileUtil.getExtension介绍

[英]Gets the file (type) extension of the given file. A file extension is the part of the filename, after the last occurence of a period '.'. If the filename contains no period, null is returned.
[中]获取给定文件的文件(类型)扩展名。文件扩展名是文件名的一部分,在句点“.”最后一次出现之后。如果文件名不包含句点,则返回null。

代码示例

代码示例来源:origin: haraldk/TwelveMonkeys

public boolean accept(File pFile) {
  // Directories are always supported
  if (pFile.isDirectory()) {
    return true;
  }
  // Test if we have an ImageWriter for this suffix
  String suffix = FileUtil.getExtension(pFile);
  return !StringUtil.isEmpty(suffix) && hasWriterForSuffix(suffix);
}

代码示例来源:origin: haraldk/TwelveMonkeys

public boolean accept(File pFile) {
  // Directories are always supported
  if (pFile.isDirectory()) {
    return true;
  }
  // See if we have an ImageReader for this suffix
  String suffix = FileUtil.getExtension(pFile);
  return !StringUtil.isEmpty(suffix) && hasReaderForSuffix(suffix);
}

代码示例来源:origin: haraldk/TwelveMonkeys

if (extension.equals("ANY") || extension.equals(FileUtil.getExtension(candidate))) {

代码示例来源:origin: haraldk/TwelveMonkeys

contentCache.put(pCacheURI + '.' + FileUtil.getExtension(content), response);

代码示例来源:origin: haraldk/TwelveMonkeys

public boolean isPresent(final String pFileName) {
  try {
    init();
  }
  catch (IOException e) {
    resetMembers();
    return false;
  }
  // TODO: Rethink this...
  // Seems to be up to Windows and the installed programs what formats
  // are supported...
  // Some thumbs are just icons, and it might be better to use ImageIO to create thumbs for these... :-/ 
  // At least this seems fine for now
  String extension = FileUtil.getExtension(pFileName);
  if (StringUtil.isEmpty(extension)) {
    return false;
  }
  extension = extension.toLowerCase();
  return !"psd".equals(extension) && !"svg".equals(extension) && catalog != null && catalog.getIndex(pFileName) != -1;
}

代码示例来源:origin: haraldk/TwelveMonkeys

format = FileUtil.getExtension(out);

代码示例来源:origin: com.twelvemonkeys/twelvemonkeys-core

/**
   * This method implements the {@code java.io.FilenameFilter} interface.
   * <p/>
   *
   * @param pDir  the directory in which the file was found.
   * @param pName the pName of the file.
   * @return {@code true} if the pName should be included in the file list;
   *         {@code false} otherwise.
   */
  public boolean accept(final File pDir, final String pName) {
    if (StringUtil.isEmpty(mFilenameSuffixesToExclude)) {
      return true;
    }

    for (String aMFilenameSuffixesToExclude : mFilenameSuffixesToExclude) {
      // -- Edit by haraldK, to make interfaces more consistent
      // if (StringUtil.filenameSuffixIs(pName, mFilenameSuffixesToExclude[i])) {
      if (aMFilenameSuffixesToExclude.equals(FileUtil.getExtension(pName))) {
        return false;
      }
    }
    return true;
  }
}

代码示例来源:origin: com.github.lafa.twelvemonkeyspurejava.imageio/imageio-core

public boolean accept(File pFile) {
  // Directories are always supported
  if (pFile.isDirectory()) {
    return true;
  }
  // See if we have an ImageReader for this suffix
  String suffix = FileUtil.getExtension(pFile);
  return !StringUtil.isEmpty(suffix) && hasReaderForSuffix(suffix);
}

代码示例来源:origin: com.twelvemonkeys.imageio/twelvemonkeys-imageio-core

public boolean accept(File pFile) {
  // Directories are always supported
  if (pFile.isDirectory()) {
    return true;
  }
  // Test if we have an ImageWriter for this suffix
  String suffix = FileUtil.getExtension(pFile);
  return !StringUtil.isEmpty(suffix) && hasWriterForSuffix(suffix);
}

代码示例来源:origin: com.github.lafa.twelvemonkeyspurejava.imageio/imageio-core

public boolean accept(File pFile) {
  // Directories are always supported
  if (pFile.isDirectory()) {
    return true;
  }
  // Test if we have an ImageWriter for this suffix
  String suffix = FileUtil.getExtension(pFile);
  return !StringUtil.isEmpty(suffix) && hasWriterForSuffix(suffix);
}

代码示例来源:origin: com.twelvemonkeys.imageio/twelvemonkeys-imageio-core

public boolean accept(File pFile) {
  // Directories are always supported
  if (pFile.isDirectory()) {
    return true;
  }
  // See if we have an ImageReader for this suffix
  String suffix = FileUtil.getExtension(pFile);
  return !StringUtil.isEmpty(suffix) && hasReaderForSuffix(suffix);
}

代码示例来源:origin: com.twelvemonkeys.imageio/imageio-thumbsdb

public boolean isPresent(final String pFileName) {
  try {
    init();
  }
  catch (IOException e) {
    resetMembers();
    return false;
  }
  // TODO: Rethink this...
  // Seems to be up to Windows and the installed programs what formats
  // are supported...
  // Some thumbs are just icons, and it might be better to use ImageIO to create thumbs for these... :-/ 
  // At least this seems fine for now
  String extension = FileUtil.getExtension(pFileName);
  if (StringUtil.isEmpty(extension)) {
    return false;
  }
  extension = extension.toLowerCase();
  return !"psd".equals(extension) && !"svg".equals(extension) && catalog != null && catalog.getIndex(pFileName) != -1;
}

代码示例来源:origin: com.github.lafa.twelvemonkeyspurejava.common/common-image

format = FileUtil.getExtension(out);

代码示例来源:origin: com.twelvemonkeys/twelvemonkeys-core

format = FileUtil.getExtension(out);

相关文章