码迷,mamicode.com
首页 > 系统相关 > 详细

截取linux文件存储路径方法

时间:2016-05-21 10:04:50      阅读:214      评论:0      收藏:0      [点我收藏+]

标签:

1.截取linux文件存储路径方法

package com.tydic.eshop.action.freemarker;

public class dddd {

    public static void main(String[] args) {
        String strParentUrl = "/home/tomcat7/ecp/t8086/webapps/ecp/FreeMarker/1463766670142/error/html/index.html";
         String[] s = strParentUrl.split("/");
         String ddd = display(s,8,s.length);
         System.out.println(ddd);
         
    }
    
      public static String display(String[] str,int a,int b) {
            StringBuffer sb = new StringBuffer();
            for(int i=a;i<b;i++) {
                sb.append("/"+str[i]);
            }
            String requestString = sb.toString().substring(1, sb.toString().length());
            return requestString;
             
             
        }
}

 

截取linux文件存储路径方法

标签:

原文地址:http://www.cnblogs.com/lr393993507/p/5514118.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!