TrueZIP Kernel 7.0-rc2

de.schlichtherle.truezip.io
Class Paths.Splitter

java.lang.Object
  extended by de.schlichtherle.truezip.io.Paths.Splitter
Enclosing class:
Paths

public static class Paths.Splitter
extends Object

Splits a given path name into its parent path name and member name.


Field Summary
private  int fixum
           
private  String memberName
           
private  String parentPath
           
private  char separatorChar
           
 
Constructor Summary
Paths.Splitter(char separatorChar, boolean keepTrailingSeparator)
          Constructs a new splitter.
 
Method Summary
 String getMemberName()
          Returns the member name.
 String getParentPath()
          Returns the parent path name.
private static int lastIndexNot(String path, char separatorChar, int last)
           
 Paths.Splitter split(String path)
          Splits the given path name into its parent path name and member name, recognizing platform specific file system roots.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

separatorChar

private final char separatorChar

fixum

private final int fixum

parentPath

@CheckForNull
private String parentPath

memberName

private String memberName
Constructor Detail

Paths.Splitter

public Paths.Splitter(char separatorChar,
                      boolean keepTrailingSeparator)
Constructs a new splitter.

Parameters:
separatorChar - the file name separator character.
keepTrailingSeparator - whether or not a parent path name should have a single trailing separator if present in the original path name.
Method Detail

split

public Paths.Splitter split(String path)
Splits the given path name into its parent path name and member name, recognizing platform specific file system roots. The returned array will hold the following strings:
  1. At index zero: The parent path name with a single trailing separatorChar or null if the path name does not specify a parent.
  2. At index one: The member name without a separatorChar.

Parameters:
path - the name of the path which's parent path name and member name are to be returned.
Returns:
this

lastIndexNot

private static int lastIndexNot(String path,
                                char separatorChar,
                                int last)

getParentPath

@Nullable
public String getParentPath()
Returns the parent path name.


getMemberName

public String getMemberName()
Returns the member name.


TrueZIP Kernel 7.0-rc2

Copyright © 2005-2011 Schlichtherle IT Services. All Rights Reserved.