Skip to content

Commit 9c33070

Browse files
committed
added an initial set of TODOs
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/io/trunk@140629 13f79535-47bb-0310-9956-ffa450edef68
1 parent 69b2ab1 commit 9c33070

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

src/java/org/apache/commons/io/FilenameUtils.java

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
* @author Matthew Hawthorne
5656
* @author Martin Cooper
5757
* @author <a href="mailto:jeremias@apache.org">Jeremias Maerki</a>
58-
* @version $Id: FilenameUtils.java,v 1.15 2004/10/29 18:28:03 bayard Exp $
58+
* @version $Id: FilenameUtils.java,v 1.16 2004/10/29 18:53:56 bayard Exp $
5959
* @since Commons IO 1.1
6060
*/
6161
public class FilenameUtils {
@@ -68,6 +68,7 @@ public class FilenameUtils {
6868
/**
6969
* Standard separator string used when internalizing paths.
7070
*/
71+
// KILL
7172
private static final String INTERNAL_SEPARATOR = "/";
7273

7374
/**
@@ -81,6 +82,7 @@ public FilenameUtils() { }
8182
* @param fileName The name of the file to check.
8283
* @return true if file exists.
8384
*/
85+
// KILL: Not filename based
8486
public static boolean fileExists(String fileName) {
8587
File file = new File(fileName);
8688
return file.exists();
@@ -93,6 +95,7 @@ public static boolean fileExists(String fileName) {
9395
*
9496
* @param fileName The name of the file to delete.
9597
*/
98+
// KILL: Not filename based
9699
public static void fileDelete(String fileName) {
97100
File file = new File(fileName);
98101
file.delete();
@@ -103,6 +106,7 @@ public static void fileDelete(String fileName) {
103106
* if necessary.
104107
* @param dir directory to create
105108
*/
109+
// KILL: Not filename based
106110
public static void mkdir(String dir) {
107111
File file = new File(dir);
108112
if (!file.exists()) {
@@ -180,6 +184,7 @@ public static String getExtension(String filename) {
180184
* @param filepath the filepath
181185
* @return the filename minus path
182186
*/
187+
// KILL? Just use StringUtils?
183188
public static String removePath(String filepath) {
184189
return removePath(filepath, File.separatorChar);
185190
}
@@ -196,6 +201,7 @@ public static String removePath(String filepath) {
196201
* @param fileSeparatorChar the file separator character to use
197202
* @return the filename minus path
198203
*/
204+
// KILL: Why allow the char to be specified?
199205
public static String removePath(
200206
String filepath,
201207
char fileSeparatorChar) {
@@ -220,6 +226,7 @@ public static String removePath(
220226
* @param filepath the filepath
221227
* @return the filename minus path
222228
*/
229+
// KILL? Just use StringUtils?
223230
public static String getPath(String filepath) {
224231
return getPath(filepath, File.separatorChar);
225232
}
@@ -236,6 +243,7 @@ public static String getPath(String filepath) {
236243
* @param fileSeparatorChar the file separator character to use
237244
* @return the filename minus path
238245
*/
246+
// KILL: Why allow the char to be specified?
239247
public static String getPath(
240248
String filepath,
241249
char fileSeparatorChar) {
@@ -267,6 +275,7 @@ public static String getPath(
267275
* @param path the path to normalize
268276
* @return the normalized String, or <code>null</code> if too many ..'s.
269277
*/
278+
// TODO: Make this non-unix specific
270279
public static String normalize(String path) {
271280
String normalized = path;
272281
// Resolve occurrences of "//" in the normalized path
@@ -332,6 +341,7 @@ public static String normalize(String path) {
332341
* @param path path the second path to attach to the first
333342
* @return The concatenated paths, or null if error occurs
334343
*/
344+
// TODO: UNIX/Windows only. Is this a problem?
335345
public static String catPath(String lookupPath, String path) {
336346
// Cut off the last slash and everything beyond
337347
int index = indexOfLastPathSeparator(lookupPath);
@@ -364,6 +374,7 @@ public static String catPath(String lookupPath, String path) {
364374
* @return The index of the last 'path separator' character, or -1 if there
365375
* is no such character.
366376
*/
377+
// KILL: Inline into above method
367378
public static int indexOfLastPathSeparator(String path) {
368379
int lastUnixPos = path.lastIndexOf('/');
369380
int lastWindowsPos = path.lastIndexOf('\\');
@@ -381,6 +392,7 @@ public static int indexOfLastPathSeparator(String path) {
381392
* @param filename Absolute or relative file path to resolve.
382393
* @return The canonical <code>File</code> of <code>filename</code>.
383394
*/
395+
// TODO: Decide whether this is worth keeping?
384396
public static File resolveFile(File baseFile, String filename) {
385397
String filenm = filename;
386398
if ('/' != File.separatorChar) {
@@ -448,6 +460,7 @@ public static File resolveFile(File baseFile, String filename) {
448460
* @param path The path to be internalized.
449461
* @return The internalized path.
450462
*/
463+
// KILL: Inline into the one place this is used
451464
private static String internalize(String path) {
452465
return path.replace('\\', INTERNAL_SEPARATOR_CHAR);
453466
}
@@ -458,6 +471,7 @@ private static String internalize(String path) {
458471
* @param path The path to be externalized.
459472
* @return The externalized path.
460473
*/
474+
// KILL: Nothing uses this
461475
private static String externalize(String path) {
462476
if (INTERNAL_SEPARATOR_CHAR != File.separatorChar) {
463477
path = path.replace(INTERNAL_SEPARATOR_CHAR, File.separatorChar);

0 commit comments

Comments
 (0)