com.simiacryptus.util.Util.stripPrefix()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(1.8k)|赞(0)|评价(0)|浏览(219)

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

Util.stripPrefix介绍

[英]Strip prefix string.
[中]带前缀字符串。

代码示例

代码示例来源:origin: com.simiacryptus/literate-reporting

  1. /**
  2. * Resolve resource file.
  3. *
  4. * @param name the name
  5. * @return the file
  6. */
  7. @Nonnull
  8. public File resolveResource(@Nonnull final CharSequence name) {
  9. return new File(getResourceDir(), Util.stripPrefix(name.toString(), "etc/"));
  10. }

代码示例来源:origin: com.simiacryptus/java-util

  1. /**
  2. * Resolve resource file.
  3. *
  4. * @param name the name
  5. * @return the file
  6. */
  7. @Nonnull
  8. public File resolveResource(@Nonnull final CharSequence name) {
  9. return new File(getResourceDir(), Util.stripPrefix(name.toString(), "etc/"));
  10. }

代码示例来源:origin: com.simiacryptus/java-util

  1. /**
  2. * Code file string.
  3. *
  4. * @param file the file
  5. * @return the string
  6. */
  7. public CharSequence pathTo(@javax.annotation.Nonnull File file) {
  8. return stripPrefix(Util.toString(pathToFile(getReportFile(), file)), "/");
  9. }

代码示例来源:origin: com.simiacryptus/literate-reporting

  1. /**
  2. * Code file string.
  3. *
  4. * @param file the file
  5. * @return the string
  6. */
  7. public CharSequence pathTo(@javax.annotation.Nonnull File file) {
  8. return stripPrefix(Util.toString(pathToFile(getReportFile(), file)), "/");
  9. }

代码示例来源:origin: com.simiacryptus/java-util

  1. @Override
  2. public Response serve(final IHTTPSession session) {
  3. String requestPath = Util.stripPrefix(session.getUri(), "/");
  4. @javax.annotation.Nonnull final File file = new File(root, requestPath);
  5. if (session.getMethod() == Method.GET) {

代码示例来源:origin: com.simiacryptus/literate-reporting

  1. @Override
  2. public Response serve(final IHTTPSession session) {
  3. String requestPath = Util.stripPrefix(session.getUri(), "/");
  4. @javax.annotation.Nonnull final File file = new File(root, requestPath);
  5. if (session.getMethod() == Method.GET) {

相关文章