2 package org
.de
.metux
.util
;
7 states which the file can have:
9 + VFile current_root -> beyond which root are we working ?
10 + boolean allow_breakout -> are we allowed to break out of the root ?
22 public static String
normalize_filename(String name
)
24 boolean absolute
= name
.startsWith("/");
25 boolean dirname
= name
.endsWith("/");
27 String splitted
[] = name
.split("\\/");
28 String newstr
[] = new String
[splitted
.length
];
31 for (int x
=0; x
<splitted
.length
; x
++)
33 String e
= splitted
[x
];
34 if ((e
==null)||(e
.equals("")||e
.equals("."))) ;
35 else if (e
.equals(".."))
47 return ((absolute
||dirname
) ?
"/" : "");
49 String str
= (absolute ?
"/" : "")+newstr
[0];
50 for (int x
=1; x
<y
; x
++)