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

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

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

FilenameUtils.doGetFullPath介绍

[英]Does the work of getting the path.
[中]完成获取路径的工作。

代码示例

代码示例来源:origin: commons-io/commons-io

/**
 * Gets the full path from a full filename, which is the prefix + path.
 * <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; C:\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/
 * C:           --&gt; C:
 * C:\          --&gt; C:\
 * ~            --&gt; ~/
 * ~/           --&gt; ~/
 * ~user        --&gt; ~user/
 * ~user/       --&gt; ~user/
 * </pre>
 * <p>
 * The output will be the same irrespective of the machine that the code is running on.
 *
 * @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 getFullPath(final String filename) {
  return doGetFullPath(filename, true);
}

代码示例来源:origin: commons-io/commons-io

/**
 * Gets the full path from a full filename, which is the prefix + path,
 * 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; C:\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
 * C:           --&gt; C:
 * C:\          --&gt; C:\
 * ~            --&gt; ~
 * ~/           --&gt; ~
 * ~user        --&gt; ~user
 * ~user/       --&gt; ~user
 * </pre>
 * <p>
 * The output will be the same irrespective of the machine that the code is running on.
 *
 * @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 getFullPathNoEndSeparator(final String filename) {
  return doGetFullPath(filename, false);
}

代码示例来源:origin: org.apache.commons/commons-io

/**
 * Gets the full path from a full filename, which is the prefix + path.
 * <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 --> C:\a\b\
 * ~/a/b/c.txt  --> ~/a/b/
 * a.txt        --> ""
 * a/b/c        --> a/b/
 * a/b/c/       --> a/b/c/
 * C:           --> C:
 * C:\          --> C:\
 * ~            --> ~/
 * ~/           --> ~/
 * ~user        --> ~user/
 * ~user/       --> ~user/
 * </pre>
 * <p>
 * The output will be the same irrespective of the machine that the code is running on.
 *
 * @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 getFullPath(String filename) {
  return doGetFullPath(filename, true);
}

代码示例来源:origin: org.apache.commons/commons-io

/**
 * Gets the full path from a full filename, which is the prefix + path,
 * 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 --> C:\a\b
 * ~/a/b/c.txt  --> ~/a/b
 * a.txt        --> ""
 * a/b/c        --> a/b
 * a/b/c/       --> a/b/c
 * C:           --> C:
 * C:\          --> C:\
 * ~            --> ~
 * ~/           --> ~
 * ~user        --> ~user
 * ~user/       --> ~user
 * </pre>
 * <p>
 * The output will be the same irrespective of the machine that the code is running on.
 *
 * @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 getFullPathNoEndSeparator(String filename) {
  return doGetFullPath(filename, false);
}

代码示例来源:origin: org.uberfire/vfs-model

/**
 * Gets the full path from a full filename, which is the prefix + path.
 * <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 --> C:\a\b\
 * ~/a/b/c.txt  --> ~/a/b/
 * a.txt        --> ""
 * a/b/c        --> a/b/
 * a/b/c/       --> a/b/c/
 * C:           --> C:
 * C:\          --> C:\
 * ~            --> ~/
 * ~/           --> ~/
 * ~user        --> ~user/
 * ~user/       --> ~user/
 * </pre>
 * <p>
 * The output will be the same irrespective of the machine that the code is running on.
 *
 * @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 getFullPath(String filename) {
  return doGetFullPath(filename, true);
}

代码示例来源:origin: org.apache.commons/com.springsource.org.apache.commons.io

/**
 * Gets the full path from a full filename, which is the prefix + path.
 * <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 --> C:\a\b\
 * ~/a/b/c.txt  --> ~/a/b/
 * a.txt        --> ""
 * a/b/c        --> a/b/
 * a/b/c/       --> a/b/c/
 * C:           --> C:
 * C:\          --> C:\
 * ~            --> ~/
 * ~/           --> ~/
 * ~user        --> ~user/
 * ~user/       --> ~user/
 * </pre>
 * <p>
 * The output will be the same irrespective of the machine that the code is running on.
 *
 * @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 getFullPath(String filename) {
  return doGetFullPath(filename, true);
}

代码示例来源:origin: org.onosproject/onlab-thirdparty

/**
 * Gets the full path from a full filename, which is the prefix + path.
 * <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 --> C:\a\b\
 * ~/a/b/c.txt  --> ~/a/b/
 * a.txt        --> ""
 * a/b/c        --> a/b/
 * a/b/c/       --> a/b/c/
 * C:           --> C:
 * C:\          --> C:\
 * ~            --> ~/
 * ~/           --> ~/
 * ~user        --> ~user/
 * ~user/       --> ~user/
 * </pre>
 * <p>
 * The output will be the same irrespective of the machine that the code is running on.
 *
 * @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 getFullPath(String filename) {
  return doGetFullPath(filename, true);
}

代码示例来源:origin: com.impetus.fabric/fabric-jdbc-driver-shaded

/**
 * Gets the full path from a full filename, which is the prefix + path.
 * <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; C:\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/
 * C:           --&gt; C:
 * C:\          --&gt; C:\
 * ~            --&gt; ~/
 * ~/           --&gt; ~/
 * ~user        --&gt; ~user/
 * ~user/       --&gt; ~user/
 * </pre>
 * <p>
 * The output will be the same irrespective of the machine that the code is running on.
 *
 * @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 getFullPath(final String filename) {
  return doGetFullPath(filename, true);
}

代码示例来源:origin: org.kie.commons/kie-nio2-model

/**
 * Gets the full path from a full filename, which is the prefix + path,
 * 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 --> C:\a\b
 * ~/a/b/c.txt  --> ~/a/b
 * a.txt        --> ""
 * a/b/c        --> a/b
 * a/b/c/       --> a/b/c
 * C:           --> C:
 * C:\          --> C:\
 * ~            --> ~
 * ~/           --> ~
 * ~user        --> ~user
 * ~user/       --> ~user
 * </pre>
 * <p>
 * The output will be the same irrespective of the machine that the code is running on.
 *
 * @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 getFullPathNoEndSeparator(String filename) {
  return doGetFullPath(filename, false);
}

代码示例来源:origin: org.apache.commons/com.springsource.org.apache.commons.io

/**
 * Gets the full path from a full filename, which is the prefix + path,
 * 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 --> C:\a\b
 * ~/a/b/c.txt  --> ~/a/b
 * a.txt        --> ""
 * a/b/c        --> a/b
 * a/b/c/       --> a/b/c
 * C:           --> C:
 * C:\          --> C:\
 * ~            --> ~
 * ~/           --> ~
 * ~user        --> ~user
 * ~user/       --> ~user
 * </pre>
 * <p>
 * The output will be the same irrespective of the machine that the code is running on.
 *
 * @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 getFullPathNoEndSeparator(String filename) {
  return doGetFullPath(filename, false);
}

代码示例来源:origin: Nextdoor/bender

/**
 * Gets the full path from a full filename, which is the prefix + path.
 * <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 --> C:\a\b\
 * ~/a/b/c.txt  --> ~/a/b/
 * a.txt        --> ""
 * a/b/c        --> a/b/
 * a/b/c/       --> a/b/c/
 * C:           --> C:
 * C:\          --> C:\
 * ~            --> ~/
 * ~/           --> ~/
 * ~user        --> ~user/
 * ~user/       --> ~user/
 * </pre>
 * <p>
 * The output will be the same irrespective of the machine that the code is running on.
 *
 * @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 getFullPath(String filename) {
  return doGetFullPath(filename, true);
}

代码示例来源:origin: com.impetus.fabric/fabric-jdbc-driver-shaded

/**
 * Gets the full path from a full filename, which is the prefix + path,
 * 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; C:\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
 * C:           --&gt; C:
 * C:\          --&gt; C:\
 * ~            --&gt; ~
 * ~/           --&gt; ~
 * ~user        --&gt; ~user
 * ~user/       --&gt; ~user
 * </pre>
 * <p>
 * The output will be the same irrespective of the machine that the code is running on.
 *
 * @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 getFullPathNoEndSeparator(final String filename) {
  return doGetFullPath(filename, false);
}

代码示例来源:origin: Nextdoor/bender

/**
 * Gets the full path from a full filename, which is the prefix + path,
 * 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 --> C:\a\b
 * ~/a/b/c.txt  --> ~/a/b
 * a.txt        --> ""
 * a/b/c        --> a/b
 * a/b/c/       --> a/b/c
 * C:           --> C:
 * C:\          --> C:\
 * ~            --> ~
 * ~/           --> ~
 * ~user        --> ~user
 * ~user/       --> ~user
 * </pre>
 * <p>
 * The output will be the same irrespective of the machine that the code is running on.
 *
 * @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 getFullPathNoEndSeparator(String filename) {
  return doGetFullPath(filename, false);
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.commons-io

/**
 * Gets the full path from a full filename, which is the prefix + path.
 * <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 --> C:\a\b\
 * ~/a/b/c.txt  --> ~/a/b/
 * a.txt        --> ""
 * a/b/c        --> a/b/
 * a/b/c/       --> a/b/c/
 * C:           --> C:
 * C:\          --> C:\
 * ~            --> ~/
 * ~/           --> ~/
 * ~user        --> ~user/
 * ~user/       --> ~user/
 * </pre>
 * <p>
 * The output will be the same irrespective of the machine that the code is running on.
 *
 * @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 getFullPath(String filename) {
  return doGetFullPath(filename, true);
}

代码示例来源:origin: org.kie.commons/kie-nio2-model

/**
 * Gets the full path from a full filename, which is the prefix + path.
 * <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 --> C:\a\b\
 * ~/a/b/c.txt  --> ~/a/b/
 * a.txt        --> ""
 * a/b/c        --> a/b/
 * a/b/c/       --> a/b/c/
 * C:           --> C:
 * C:\          --> C:\
 * ~            --> ~/
 * ~/           --> ~/
 * ~user        --> ~user/
 * ~user/       --> ~user/
 * </pre>
 * <p>
 * The output will be the same irrespective of the machine that the code is running on.
 *
 * @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 getFullPath(String filename) {
  return doGetFullPath(filename, true);
}

代码示例来源:origin: io.github.stephenc.docker/docker-client-shaded

/**
 * Gets the full path from a full filename, which is the prefix + path.
 * <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; C:\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/
 * C:           --&gt; C:
 * C:\          --&gt; C:\
 * ~            --&gt; ~/
 * ~/           --&gt; ~/
 * ~user        --&gt; ~user/
 * ~user/       --&gt; ~user/
 * </pre>
 * <p>
 * The output will be the same irrespective of the machine that the code is running on.
 *
 * @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 getFullPath(final String filename) {
  return doGetFullPath(filename, true);
}

代码示例来源:origin: org.uberfire/vfs-model

/**
 * Gets the full path from a full filename, which is the prefix + path,
 * 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 --> C:\a\b
 * ~/a/b/c.txt  --> ~/a/b
 * a.txt        --> ""
 * a/b/c        --> a/b
 * a/b/c/       --> a/b/c
 * C:           --> C:
 * C:\          --> C:\
 * ~            --> ~
 * ~/           --> ~
 * ~user        --> ~user
 * ~user/       --> ~user
 * </pre>
 * <p>
 * The output will be the same irrespective of the machine that the code is running on.
 *
 * @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 getFullPathNoEndSeparator(String filename) {
  return doGetFullPath(filename, false);
}

代码示例来源:origin: io.github.stephenc.docker/docker-client-shaded

/**
 * Gets the full path from a full filename, which is the prefix + path,
 * 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; C:\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
 * C:           --&gt; C:
 * C:\          --&gt; C:\
 * ~            --&gt; ~
 * ~/           --&gt; ~
 * ~user        --&gt; ~user
 * ~user/       --&gt; ~user
 * </pre>
 * <p>
 * The output will be the same irrespective of the machine that the code is running on.
 *
 * @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 getFullPathNoEndSeparator(final String filename) {
  return doGetFullPath(filename, false);
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.commons-io

/**
 * Gets the full path from a full filename, which is the prefix + path,
 * 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 --> C:\a\b
 * ~/a/b/c.txt  --> ~/a/b
 * a.txt        --> ""
 * a/b/c        --> a/b
 * a/b/c/       --> a/b/c
 * C:           --> C:
 * C:\          --> C:\
 * ~            --> ~
 * ~/           --> ~
 * ~user        --> ~user
 * ~user/       --> ~user
 * </pre>
 * <p>
 * The output will be the same irrespective of the machine that the code is running on.
 *
 * @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 getFullPathNoEndSeparator(String filename) {
  return doGetFullPath(filename, false);
}

代码示例来源:origin: org.onosproject/onlab-thirdparty

/**
 * Gets the full path from a full filename, which is the prefix + path,
 * 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 --> C:\a\b
 * ~/a/b/c.txt  --> ~/a/b
 * a.txt        --> ""
 * a/b/c        --> a/b
 * a/b/c/       --> a/b/c
 * C:           --> C:
 * C:\          --> C:\
 * ~            --> ~
 * ~/           --> ~
 * ~user        --> ~user
 * ~user/       --> ~user
 * </pre>
 * <p>
 * The output will be the same irrespective of the machine that the code is running on.
 *
 * @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 getFullPathNoEndSeparator(String filename) {
  return doGetFullPath(filename, false);
}

相关文章