本文整理了Java中org.apache.commons.io.FilenameUtils.doGetPath()
方法的一些代码示例,展示了FilenameUtils.doGetPath()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。FilenameUtils.doGetPath()
方法的具体详情如下:
包路径:org.apache.commons.io.FilenameUtils
类名称:FilenameUtils
方法名:doGetPath
[英]Does the work of getting the path.
[中]完成获取路径的工作。
代码示例来源:origin: commons-io/commons-io
/**
* Gets the path from a full filename, which excludes the prefix, and
* also excluding the final directory separator.
* <p>
* This method will handle a file in either Unix or Windows format.
* The method is entirely text based, and returns the text before the
* last forward or backslash.
* <pre>
* C:\a\b\c.txt --> a\b
* ~/a/b/c.txt --> a/b
* a.txt --> ""
* a/b/c --> a/b
* a/b/c/ --> a/b/c
* </pre>
* <p>
* The output will be the same irrespective of the machine that the code is running on.
* <p>
* This method drops the prefix from the result.
* See {@link #getFullPathNoEndSeparator(String)} for the method that retains the prefix.
*
* @param filename the filename to query, null returns null
* @return the path of the file, an empty string if none exists, null if invalid.
* Null bytes inside string will be removed
*/
public static String getPathNoEndSeparator(final String filename) {
return doGetPath(filename, 0);
}
代码示例来源:origin: commons-io/commons-io
/**
* Gets the path from a full filename, which excludes the prefix.
* <p>
* This method will handle a file in either Unix or Windows format.
* The method is entirely text based, and returns the text before and
* including the last forward or backslash.
* <pre>
* C:\a\b\c.txt --> a\b\
* ~/a/b/c.txt --> a/b/
* a.txt --> ""
* a/b/c --> a/b/
* a/b/c/ --> a/b/c/
* </pre>
* <p>
* The output will be the same irrespective of the machine that the code is running on.
* <p>
* This method drops the prefix from the result.
* See {@link #getFullPath(String)} for the method that retains the prefix.
*
* @param filename the filename to query, null returns null
* @return the path of the file, an empty string if none exists, null if invalid.
* Null bytes inside string will be removed
*/
public static String getPath(final String filename) {
return doGetPath(filename, 1);
}
代码示例来源:origin: org.apache.commons/commons-io
/**
* Gets the path from a full filename, which excludes the prefix.
* <p>
* This method will handle a file in either Unix or Windows format.
* The method is entirely text based, and returns the text before and
* including the last forward or backslash.
* <pre>
* C:\a\b\c.txt --> a\b\
* ~/a/b/c.txt --> a/b/
* a.txt --> ""
* a/b/c --> a/b/
* a/b/c/ --> a/b/c/
* </pre>
* <p>
* The output will be the same irrespective of the machine that the code is running on.
* <p>
* This method drops the prefix from the result.
* See {@link #getFullPath(String)} for the method that retains the prefix.
*
* @param filename the filename to query, null returns null
* @return the path of the file, an empty string if none exists, null if invalid
*/
public static String getPath(String filename) {
return doGetPath(filename, 1);
}
代码示例来源:origin: org.apache.commons/commons-io
/**
* Gets the path from a full filename, which excludes the prefix, and
* also excluding the final directory separator.
* <p>
* This method will handle a file in either Unix or Windows format.
* The method is entirely text based, and returns the text before the
* last forward or backslash.
* <pre>
* C:\a\b\c.txt --> a\b
* ~/a/b/c.txt --> a/b
* a.txt --> ""
* a/b/c --> a/b
* a/b/c/ --> a/b/c
* </pre>
* <p>
* The output will be the same irrespective of the machine that the code is running on.
* <p>
* This method drops the prefix from the result.
* See {@link #getFullPathNoEndSeparator(String)} for the method that retains the prefix.
*
* @param filename the filename to query, null returns null
* @return the path of the file, an empty string if none exists, null if invalid
*/
public static String getPathNoEndSeparator(String filename) {
return doGetPath(filename, 0);
}
代码示例来源:origin: com.impetus.fabric/fabric-jdbc-driver-shaded
/**
* Gets the path from a full filename, which excludes the prefix, and
* also excluding the final directory separator.
* <p>
* This method will handle a file in either Unix or Windows format.
* The method is entirely text based, and returns the text before the
* last forward or backslash.
* <pre>
* C:\a\b\c.txt --> a\b
* ~/a/b/c.txt --> a/b
* a.txt --> ""
* a/b/c --> a/b
* a/b/c/ --> a/b/c
* </pre>
* <p>
* The output will be the same irrespective of the machine that the code is running on.
* <p>
* This method drops the prefix from the result.
* See {@link #getFullPathNoEndSeparator(String)} for the method that retains the prefix.
*
* @param filename the filename to query, null returns null
* @return the path of the file, an empty string if none exists, null if invalid.
* Null bytes inside string will be removed
*/
public static String getPathNoEndSeparator(final String filename) {
return doGetPath(filename, 0);
}
代码示例来源:origin: org.kie.commons/kie-nio2-model
/**
* Gets the path from a full filename, which excludes the prefix.
* <p>
* This method will handle a file in either Unix or Windows format.
* The method is entirely text based, and returns the text before and
* including the last forward or backslash.
* <pre>
* C:\a\b\c.txt --> a\b\
* ~/a/b/c.txt --> a/b/
* a.txt --> ""
* a/b/c --> a/b/
* a/b/c/ --> a/b/c/
* </pre>
* <p>
* The output will be the same irrespective of the machine that the code is running on.
* <p>
* This method drops the prefix from the result.
* See {@link #getFullPath(String)} for the method that retains the prefix.
*
* @param filename the filename to query, null returns null
* @return the path of the file, an empty string if none exists, null if invalid
*/
public static String getPath(String filename) {
return doGetPath(filename, 1);
}
代码示例来源:origin: io.github.stephenc.docker/docker-client-shaded
/**
* Gets the path from a full filename, which excludes the prefix, and
* also excluding the final directory separator.
* <p>
* This method will handle a file in either Unix or Windows format.
* The method is entirely text based, and returns the text before the
* last forward or backslash.
* <pre>
* C:\a\b\c.txt --> a\b
* ~/a/b/c.txt --> a/b
* a.txt --> ""
* a/b/c --> a/b
* a/b/c/ --> a/b/c
* </pre>
* <p>
* The output will be the same irrespective of the machine that the code is running on.
* <p>
* This method drops the prefix from the result.
* See {@link #getFullPathNoEndSeparator(String)} for the method that retains the prefix.
*
* @param filename the filename to query, null returns null
* @return the path of the file, an empty string if none exists, null if invalid.
* Null bytes inside string will be removed
*/
public static String getPathNoEndSeparator(final String filename) {
return doGetPath(filename, 0);
}
代码示例来源:origin: Nextdoor/bender
/**
* Gets the path from a full filename, which excludes the prefix, and
* also excluding the final directory separator.
* <p>
* This method will handle a file in either Unix or Windows format.
* The method is entirely text based, and returns the text before the
* last forward or backslash.
* <pre>
* C:\a\b\c.txt --> a\b
* ~/a/b/c.txt --> a/b
* a.txt --> ""
* a/b/c --> a/b
* a/b/c/ --> a/b/c
* </pre>
* <p>
* The output will be the same irrespective of the machine that the code is running on.
* <p>
* This method drops the prefix from the result.
* See {@link #getFullPathNoEndSeparator(String)} for the method that retains the prefix.
*
* @param filename the filename to query, null returns null
* @return the path of the file, an empty string if none exists, null if invalid
*/
public static String getPathNoEndSeparator(String filename) {
return doGetPath(filename, 0);
}
代码示例来源:origin: org.onosproject/onlab-thirdparty
/**
* Gets the path from a full filename, which excludes the prefix.
* <p>
* This method will handle a file in either Unix or Windows format.
* The method is entirely text based, and returns the text before and
* including the last forward or backslash.
* <pre>
* C:\a\b\c.txt --> a\b\
* ~/a/b/c.txt --> a/b/
* a.txt --> ""
* a/b/c --> a/b/
* a/b/c/ --> a/b/c/
* </pre>
* <p>
* The output will be the same irrespective of the machine that the code is running on.
* <p>
* This method drops the prefix from the result.
* See {@link #getFullPath(String)} for the method that retains the prefix.
*
* @param filename the filename to query, null returns null
* @return the path of the file, an empty string if none exists, null if invalid
*/
public static String getPath(String filename) {
return doGetPath(filename, 1);
}
代码示例来源:origin: Nextdoor/bender
/**
* Gets the path from a full filename, which excludes the prefix.
* <p>
* This method will handle a file in either Unix or Windows format.
* The method is entirely text based, and returns the text before and
* including the last forward or backslash.
* <pre>
* C:\a\b\c.txt --> a\b\
* ~/a/b/c.txt --> a/b/
* a.txt --> ""
* a/b/c --> a/b/
* a/b/c/ --> a/b/c/
* </pre>
* <p>
* The output will be the same irrespective of the machine that the code is running on.
* <p>
* This method drops the prefix from the result.
* See {@link #getFullPath(String)} for the method that retains the prefix.
*
* @param filename the filename to query, null returns null
* @return the path of the file, an empty string if none exists, null if invalid
*/
public static String getPath(String filename) {
return doGetPath(filename, 1);
}
代码示例来源:origin: org.apache.commons/com.springsource.org.apache.commons.io
/**
* Gets the path from a full filename, which excludes the prefix, and
* also excluding the final directory separator.
* <p>
* This method will handle a file in either Unix or Windows format.
* The method is entirely text based, and returns the text before the
* last forward or backslash.
* <pre>
* C:\a\b\c.txt --> a\b
* ~/a/b/c.txt --> a/b
* a.txt --> ""
* a/b/c --> a/b
* a/b/c/ --> a/b/c
* </pre>
* <p>
* The output will be the same irrespective of the machine that the code is running on.
* <p>
* This method drops the prefix from the result.
* See {@link #getFullPathNoEndSeparator(String)} for the method that retains the prefix.
*
* @param filename the filename to query, null returns null
* @return the path of the file, an empty string if none exists, null if invalid
*/
public static String getPathNoEndSeparator(String filename) {
return doGetPath(filename, 0);
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.commons-io
/**
* Gets the path from a full filename, which excludes the prefix, and
* also excluding the final directory separator.
* <p>
* This method will handle a file in either Unix or Windows format.
* The method is entirely text based, and returns the text before the
* last forward or backslash.
* <pre>
* C:\a\b\c.txt --> a\b
* ~/a/b/c.txt --> a/b
* a.txt --> ""
* a/b/c --> a/b
* a/b/c/ --> a/b/c
* </pre>
* <p>
* The output will be the same irrespective of the machine that the code is running on.
* <p>
* This method drops the prefix from the result.
* See {@link #getFullPathNoEndSeparator(String)} for the method that retains the prefix.
*
* @param filename the filename to query, null returns null
* @return the path of the file, an empty string if none exists, null if invalid
*/
public static String getPathNoEndSeparator(String filename) {
return doGetPath(filename, 0);
}
代码示例来源:origin: org.apache.commons/com.springsource.org.apache.commons.io
/**
* Gets the path from a full filename, which excludes the prefix.
* <p>
* This method will handle a file in either Unix or Windows format.
* The method is entirely text based, and returns the text before and
* including the last forward or backslash.
* <pre>
* C:\a\b\c.txt --> a\b\
* ~/a/b/c.txt --> a/b/
* a.txt --> ""
* a/b/c --> a/b/
* a/b/c/ --> a/b/c/
* </pre>
* <p>
* The output will be the same irrespective of the machine that the code is running on.
* <p>
* This method drops the prefix from the result.
* See {@link #getFullPath(String)} for the method that retains the prefix.
*
* @param filename the filename to query, null returns null
* @return the path of the file, an empty string if none exists, null if invalid
*/
public static String getPath(String filename) {
return doGetPath(filename, 1);
}
代码示例来源:origin: org.uberfire/vfs-model
/**
* Gets the path from a full filename, which excludes the prefix, and
* also excluding the final directory separator.
* <p>
* This method will handle a file in either Unix or Windows format.
* The method is entirely text based, and returns the text before the
* last forward or backslash.
* <pre>
* C:\a\b\c.txt --> a\b
* ~/a/b/c.txt --> a/b
* a.txt --> ""
* a/b/c --> a/b
* a/b/c/ --> a/b/c
* </pre>
* <p>
* The output will be the same irrespective of the machine that the code is running on.
* <p>
* This method drops the prefix from the result.
* See {@link #getFullPathNoEndSeparator(String)} for the method that retains the prefix.
*
* @param filename the filename to query, null returns null
* @return the path of the file, an empty string if none exists, null if invalid
*/
public static String getPathNoEndSeparator(String filename) {
return doGetPath(filename, 0);
}
代码示例来源:origin: io.github.stephenc.docker/docker-client-shaded
/**
* Gets the path from a full filename, which excludes the prefix.
* <p>
* This method will handle a file in either Unix or Windows format.
* The method is entirely text based, and returns the text before and
* including the last forward or backslash.
* <pre>
* C:\a\b\c.txt --> a\b\
* ~/a/b/c.txt --> a/b/
* a.txt --> ""
* a/b/c --> a/b/
* a/b/c/ --> a/b/c/
* </pre>
* <p>
* The output will be the same irrespective of the machine that the code is running on.
* <p>
* This method drops the prefix from the result.
* See {@link #getFullPath(String)} for the method that retains the prefix.
*
* @param filename the filename to query, null returns null
* @return the path of the file, an empty string if none exists, null if invalid.
* Null bytes inside string will be removed
*/
public static String getPath(final String filename) {
return doGetPath(filename, 1);
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.commons-io
/**
* Gets the path from a full filename, which excludes the prefix.
* <p>
* This method will handle a file in either Unix or Windows format.
* The method is entirely text based, and returns the text before and
* including the last forward or backslash.
* <pre>
* C:\a\b\c.txt --> a\b\
* ~/a/b/c.txt --> a/b/
* a.txt --> ""
* a/b/c --> a/b/
* a/b/c/ --> a/b/c/
* </pre>
* <p>
* The output will be the same irrespective of the machine that the code is running on.
* <p>
* This method drops the prefix from the result.
* See {@link #getFullPath(String)} for the method that retains the prefix.
*
* @param filename the filename to query, null returns null
* @return the path of the file, an empty string if none exists, null if invalid
*/
public static String getPath(String filename) {
return doGetPath(filename, 1);
}
代码示例来源:origin: org.uberfire/vfs-model
/**
* Gets the path from a full filename, which excludes the prefix.
* <p>
* This method will handle a file in either Unix or Windows format.
* The method is entirely text based, and returns the text before and
* including the last forward or backslash.
* <pre>
* C:\a\b\c.txt --> a\b\
* ~/a/b/c.txt --> a/b/
* a.txt --> ""
* a/b/c --> a/b/
* a/b/c/ --> a/b/c/
* </pre>
* <p>
* The output will be the same irrespective of the machine that the code is running on.
* <p>
* This method drops the prefix from the result.
* See {@link #getFullPath(String)} for the method that retains the prefix.
*
* @param filename the filename to query, null returns null
* @return the path of the file, an empty string if none exists, null if invalid
*/
public static String getPath(String filename) {
return doGetPath(filename, 1);
}
代码示例来源:origin: org.kie.commons/kie-nio2-model
/**
* Gets the path from a full filename, which excludes the prefix, and
* also excluding the final directory separator.
* <p>
* This method will handle a file in either Unix or Windows format.
* The method is entirely text based, and returns the text before the
* last forward or backslash.
* <pre>
* C:\a\b\c.txt --> a\b
* ~/a/b/c.txt --> a/b
* a.txt --> ""
* a/b/c --> a/b
* a/b/c/ --> a/b/c
* </pre>
* <p>
* The output will be the same irrespective of the machine that the code is running on.
* <p>
* This method drops the prefix from the result.
* See {@link #getFullPathNoEndSeparator(String)} for the method that retains the prefix.
*
* @param filename the filename to query, null returns null
* @return the path of the file, an empty string if none exists, null if invalid
*/
public static String getPathNoEndSeparator(String filename) {
return doGetPath(filename, 0);
}
代码示例来源:origin: org.onosproject/onlab-thirdparty
/**
* Gets the path from a full filename, which excludes the prefix, and
* also excluding the final directory separator.
* <p>
* This method will handle a file in either Unix or Windows format.
* The method is entirely text based, and returns the text before the
* last forward or backslash.
* <pre>
* C:\a\b\c.txt --> a\b
* ~/a/b/c.txt --> a/b
* a.txt --> ""
* a/b/c --> a/b
* a/b/c/ --> a/b/c
* </pre>
* <p>
* The output will be the same irrespective of the machine that the code is running on.
* <p>
* This method drops the prefix from the result.
* See {@link #getFullPathNoEndSeparator(String)} for the method that retains the prefix.
*
* @param filename the filename to query, null returns null
* @return the path of the file, an empty string if none exists, null if invalid
*/
public static String getPathNoEndSeparator(String filename) {
return doGetPath(filename, 0);
}
代码示例来源:origin: com.impetus.fabric/fabric-jdbc-driver-shaded
/**
* Gets the path from a full filename, which excludes the prefix.
* <p>
* This method will handle a file in either Unix or Windows format.
* The method is entirely text based, and returns the text before and
* including the last forward or backslash.
* <pre>
* C:\a\b\c.txt --> a\b\
* ~/a/b/c.txt --> a/b/
* a.txt --> ""
* a/b/c --> a/b/
* a/b/c/ --> a/b/c/
* </pre>
* <p>
* The output will be the same irrespective of the machine that the code is running on.
* <p>
* This method drops the prefix from the result.
* See {@link #getFullPath(String)} for the method that retains the prefix.
*
* @param filename the filename to query, null returns null
* @return the path of the file, an empty string if none exists, null if invalid.
* Null bytes inside string will be removed
*/
public static String getPath(final String filename) {
return doGetPath(filename, 1);
}
内容来源于网络,如有侵权,请联系作者删除!