Java Code Examples for org.springframework.util.StringUtils#getFilename()

The following examples show how to use org.springframework.util.StringUtils#getFilename() . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
private void generate(Directory root, File pomFile, boolean generateChecksums) {
	String name = StringUtils.getFilename(pomFile.getName());
	String extension = StringUtils.getFilenameExtension(pomFile.getName());
	String prefix = name.substring(0, name.length() - extension.length() - 1);
	File[] files = pomFile.getParentFile().listFiles((f) -> include(f, prefix));
	MultiValueMap<File, MavenCoordinates> fileCoordinates = new LinkedMultiValueMap<>();
	for (File file : files) {
		String rootPath = StringUtils.cleanPath(root.getFile().getPath());
		String relativePath = StringUtils.cleanPath(file.getPath()).substring(rootPath.length() + 1);
		fileCoordinates.add(file.getParentFile(), MavenCoordinates.fromPath(relativePath));
	}
	fileCoordinates.forEach((file, coordinates) -> writeMetadata(file, coordinates, generateChecksums));
}
 
Example 2
Source Project: spring-analysis-note   File: UrlResource.java    License: MIT License 4 votes vote down vote up
/**
 * This implementation returns the name of the file that this URL refers to.
 * @see java.net.URL#getPath()
 */
@Override
public String getFilename() {
	return StringUtils.getFilename(this.cleanedUrl.getPath());
}
 
Example 3
Source Project: spring-analysis-note   File: ClassPathResource.java    License: MIT License 4 votes vote down vote up
/**
 * This implementation returns the name of the file that this class path
 * resource refers to.
 * @see org.springframework.util.StringUtils#getFilename(String)
 */
@Override
@Nullable
public String getFilename() {
	return StringUtils.getFilename(this.path);
}
 
Example 4
/**
 * This implementation returns the name of the file that this ServletContext
 * resource refers to.
 * @see org.springframework.util.StringUtils#getFilename(String)
 */
@Override
@Nullable
public String getFilename() {
	return StringUtils.getFilename(this.path);
}
 
Example 5
Source Project: java-technology-stack   File: UrlResource.java    License: MIT License 4 votes vote down vote up
/**
 * This implementation returns the name of the file that this URL refers to.
 * @see java.net.URL#getPath()
 */
@Override
public String getFilename() {
	return StringUtils.getFilename(this.cleanedUrl.getPath());
}
 
Example 6
/**
 * This implementation returns the name of the file that this class path
 * resource refers to.
 * @see org.springframework.util.StringUtils#getFilename(String)
 */
@Override
@Nullable
public String getFilename() {
	return StringUtils.getFilename(this.path);
}
 
Example 7
/**
 * This implementation returns the name of the file that this ServletContext
 * resource refers to.
 * @see org.springframework.util.StringUtils#getFilename(String)
 */
@Override
@Nullable
public String getFilename() {
	return StringUtils.getFilename(this.path);
}
 
Example 8
Source Project: lams   File: UrlResource.java    License: GNU General Public License v2.0 4 votes vote down vote up
/**
 * This implementation returns the name of the file that this URL refers to.
 * @see java.net.URL#getPath()
 */
@Override
public String getFilename() {
	return StringUtils.getFilename(this.cleanedUrl.getPath());
}
 
Example 9
@Override
public String getFilename() {
	return StringUtils.getFilename(this.path);
}
 
Example 10
/**
 * 获取文件后缀名
 *
 * @param path 文件路径
 * @return {String}
 */
@Nullable
public static String getFilename(@Nullable String path) {
	return StringUtils.getFilename(path);
}
 
Example 11
/**
 * This implementation returns the name of the file that this ServletContext
 * resource refers to.
 * @see org.springframework.util.StringUtils#getFilename(String)
 */
@Override
public String getFilename() {
	return StringUtils.getFilename(this.path);
}
 
Example 12
/**
 * This implementation returns the name of the file that this class path
 * resource refers to.
 * @see org.springframework.util.StringUtils#getFilename(String)
 */
@Override
public String getFilename() {
	return StringUtils.getFilename(this.path);
}
 
Example 13
/**
 * This implementation returns the name of the file that this class path
 * resource refers to.
 * @see org.springframework.util.StringUtils#getFilename(String)
 */
@Override
public String getFilename() {
	return StringUtils.getFilename(this.path);
}
 
Example 14
/**
 * This implementation returns the name of the file that this ServletContext
 * resource refers to.
 * @see org.springframework.util.StringUtils#getFilename(String)
 */
@Override
public String getFilename() {
	return StringUtils.getFilename(this.path);
}