List of usage examples for org.springframework.util StringUtils getFilenameExtension
@Nullable public static String getFilenameExtension(@Nullable String path)
From source file:org.springframework.xd.integration.test.HdfsTest.java
private String getTestFilePath(String directory, FileStatus status) { String fileName = status.getPath().getName(); if (StringUtils.getFilenameExtension(fileName).equals("tmp")) { fileName = FilenameUtils.removeExtension(fileName); }/* www. j a va 2 s .co m*/ return directory + "/" + fileName; }
From source file:uk.ac.ebi.metabolights.controller.FileDispatcherController.java
public static void streamFile(File file, HttpServletResponse response) { // get the extension String extension = StringUtils.getFilenameExtension(file.getName()); // let the browser know the type of file String contenType = "application/" + extension; streamFile(file, response, contenType); }