src/share/tools/ProjectCreator/Util.java

changeset 2540
15d6977f04b0
parent 2314
f95d63e2154a
child 2675
74e790c48cd4
equal deleted inserted replaced
2521:b83527d0482d 2540:15d6977f04b0
1 /* 1 /*
2 * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
45 } 45 }
46 46
47 return sb.toString(); 47 return sb.toString();
48 } 48 }
49 49
50 static String join(String padder, String v[]) { 50 static String join(String padder, String v[]) {
51 StringBuffer sb = new StringBuffer(); 51 StringBuffer sb = new StringBuffer();
52 52
53 for (int i=0; i<v.length; i++) { 53 for (int i=0; i<v.length; i++) {
54 sb.append(v[i]); 54 sb.append(v[i]);
55 if (i < (v.length - 1)) sb.append(padder); 55 if (i < (v.length - 1)) sb.append(padder);
78 return sb.toString(); 78 return sb.toString();
79 } 79 }
80 80
81 81
82 static String normalize(String file) { 82 static String normalize(String file) {
83 return file.replace('\\', '/'); 83 file = file.replace('\\', '/');
84 if (file.length() > 2) {
85 if (file.charAt(1) == ':' && file.charAt(2) == '/') {
86 // convert drive letter to uppercase
87 String drive = file.substring(0, 1).toUpperCase();
88 return drive + file.substring(1);
89 }
90 }
91 return file;
84 } 92 }
85 93
86 static String sep = File.separator; 94 static String sep = File.separator;
87 static String os = "Win32"; //System.getProperty("os.name");
88 } 95 }

mercurial