Returns a suffix string from a File.

@param file The file to know the suffix.

@return A suffix string
484136
public static String getSuffix(File file) {

        String filename = file.getName();
        int index = filename.lastIndexOf(".");
        if (index != -1) {
            return filename.substring(index + 1);
        }

        return filename;
    }
97625
public static String getFileExtension(File file) {
		return com.google.common.io.Files.getFileExtension(file.getName());
	}
63376
public JavaFileObject asJavaFileObject(File file) {
        JavacFileManager fm = (JavacFileManager)context.get(JavaFileManager.class);
        return fm.getRegularFile(file);
    }
283069
public static String createUniqueFileName(String fileName) {

        int    index  = fileName.lastIndexOf(".");
        String suffix = fileName.substring(index);
        String uqName = UUIDUtils.getUUID16() + suffix;
        return uqName;
    }
1328049
private static String getFileExtension(Resource file) {
	String name = file.getName();
	String[] arr;
	try {
	    arr = ListUtil.toStringArray(ListUtil.listToArrayRemoveEmpty(name, '.'));
	}
	catch (PageException e) {
	    arr = null;
	}
	if (arr.length < 2) return "";

	return arr[arr.length - 1];
    }
14902
static String readFile(String file) {

        try {
            FileReader     reader = new FileReader(file);
            BufferedReader read   = new BufferedReader(reader);
            StringBuffer   b      = new StringBuffer();
            String         s      = null;
            int            count  = 0;

            while ((s = read.readLine()) != null) {
                count++;

                b.append(s);
                b.append('\n');
            }

            read.close();
            reader.close();

            return b.toString();
        } catch (IOException e) {
            return e.getMessage();
        }
    }
919765
public Engine fromFile(File file) throws IOException {
        BufferedReader reader = new BufferedReader(new InputStreamReader(
                new FileInputStream(file), FuzzyLite.UTF_8));
        String line;
        StringBuilder textEngine = new StringBuilder();
        try {
            while ((line = reader.readLine()) != null) {
                textEngine.append(line).append("\n");
            }
        } catch (IOException ex) {
            throw ex;
        } finally {
            reader.close();
        }
        return fromString(textEngine.toString());
    }
544716
protected ScriptEngine getScriptEngine(File file)
    {
        final String extension = getExtension(file.getName());
        if (extension == null)
        {
            return null;
        }

        return getScriptEngineManager().getEngineByExtension(extension);
    }
1137889
public static String getFileExtension( String filename )
    {
        int lastDot = filename.lastIndexOf( '.' );
        return lastDot != -1 ? filename.substring( lastDot + 1 ) : "";
    }
234744
@NonNull
  public static String readFromFile(@NonNull File file) throws FileNotFoundException {
    InputStream inputStream = new FileInputStream(file);
    Reader inputStreamReader = new InputStreamReader(inputStream);
    StringWriter output = new StringWriter();
    try {
      final char[] buffer = new char[DEFAULT_BUFFER_SIZE_IN_BYTES];
      int count;
      while ((count = inputStreamReader.read(buffer)) != -1) {
        output.write(buffer, 0, count);
      }
    } catch (IOException ioe) {
      Log.w(LOG_TAG, ioe.toString());
    } finally {
      try {
        inputStreamReader.close();
      } catch (IOException ioe) {
        Log.e(LOG_TAG, ioe.toString());
      }
    }
    return output.toString();
  }
1207236
public static String readContent( File file ) throws IOException
    {
        Reader input = null;
        try
        {
            input = new FileReader( file );
            return readContent( input );
        }
        finally
        {
            closeQuietly( input );
        }
    }
648078
public static String readTextFile(File file) {
        try {
            return readTextFile(new FileReader(file));
        } catch (FileNotFoundException e) {
            e.printStackTrace();
            return null;
        }
    }
275696
private static String getFileExtension(Resource file) {
	String name = file.getName();
	int index = name.lastIndexOf('.');
	if (index == -1) return null;
	return name.substring(index + 1).trim();
    }
173235
public static String getExtension(String fileName) {
        if (fileName == null)
            return null;
        if (fileName.isEmpty())
            return "";

        int idx = fileName.lastIndexOf(".");
        if (idx != -1) {
            return fileName.substring(idx);
        } else {
            return "";
        }
    }
319823
private static String getFileName(Resource file) {
	String name = file.getName();
	int pos = name.lastIndexOf(".");

	if (pos == -1) return name;
	return name.substring(0, pos);
    }
624568
public String guessContentTypeFromFile(File file) {
        String contentType = URLConnection.guessContentTypeFromName(file.getName());
        if (contentType == null) {
            return "application/octet-stream";
        } else {
            return contentType;
        }
    }
1230640
public static String readFileToString(String _file) {
        List<String> localText = getTextfileFromUrl(_file);
        if (localText == null) {
            return null;
        }

        return StringUtil.join(guessLineTerminatorOfFile(_file), localText);
    }