org.apache.commons.io.FilenameUtils.doGetPath()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(16.7k)|赞(0)|评价(0)|浏览(139)

本文整理了Java中org.apache.commons.io.FilenameUtils.doGetPath()方法的一些代码示例,展示了FilenameUtils.doGetPath()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。FilenameUtils.doGetPath()方法的具体详情如下:
包路径:org.apache.commons.io.FilenameUtils
类名称:FilenameUtils
方法名:doGetPath

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 --&gt; a\b
 * ~/a/b/c.txt  --&gt; a/b
 * a.txt        --&gt; ""
 * a/b/c        --&gt; a/b
 * a/b/c/       --&gt; 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 --&gt; a\b\
 * ~/a/b/c.txt  --&gt; a/b/
 * a.txt        --&gt; ""
 * a/b/c        --&gt; a/b/
 * a/b/c/       --&gt; 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 --&gt; a\b
 * ~/a/b/c.txt  --&gt; a/b
 * a.txt        --&gt; ""
 * a/b/c        --&gt; a/b
 * a/b/c/       --&gt; 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 --&gt; a\b
 * ~/a/b/c.txt  --&gt; a/b
 * a.txt        --&gt; ""
 * a/b/c        --&gt; a/b
 * a/b/c/       --&gt; 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 --&gt; a\b\
 * ~/a/b/c.txt  --&gt; a/b/
 * a.txt        --&gt; ""
 * a/b/c        --&gt; a/b/
 * a/b/c/       --&gt; 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 --&gt; a\b\
 * ~/a/b/c.txt  --&gt; a/b/
 * a.txt        --&gt; ""
 * a/b/c        --&gt; a/b/
 * a/b/c/       --&gt; 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);
}

相关文章