mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-13 20:12:14 +00:00
added a convenience method.
git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@23290 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
1 parent
4f7d907ab1
commit
0449001bd4
1 file changed
+11
@@ -766,6 +766,17 @@ public final class FilePath implements Serializable {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the file name portion except the extension.
|
||||
*
|
||||
* For example, "foo" for "foo.txt" and "foo.tar" for "foo.tar.gz".
|
||||
*/
|
||||
public String getBaseName() {
|
||||
String n = getName();
|
||||
int idx = n.lastIndexOf('.');
|
||||
if (idx<0) return n;
|
||||
return n.substring(0,idx);
|
||||
}
|
||||
/**
|
||||
* Gets just the file name portion.
|
||||
*
|
||||
|
||||
Reference in new issue
Block a user