protected AbstractPath( final FS fs, final String path, final String host, boolean isRoot, boolean isRealPath, boolean isNormalized ) { checkNotNull( "path", path ); this.fs = checkNotNull( "fs", fs ); this.host = checkNotNull( "host", host ); this.isRealPath = isRealPath; this.isNormalized = isNormalized; this.usesWindowsFormat = path.matches( ".*\\\\.*" ); final RootInfo rootInfo = setupRoot( fs, path, host, isRoot ); this.path = rootInfo.path; checkNotNull( "rootInfo", rootInfo ); this.isAbsolute = rootInfo.isAbsolute; int lastOffset = rootInfo.startOffset; for ( int i = lastOffset; i < this.path.length; i++ ) { final byte b = this.path[ i ]; if ( b == getSeparator() ) { offsets.add( newPair( lastOffset, i ) ); i++; lastOffset = i; } } if ( lastOffset < this.path.length ) { offsets.add( newPair( lastOffset, this.path.length ) ); } this.isRoot = rootInfo.isRoot; }