public boolean isTooLong() { PathSpec ps = fileSystem.get80().getPathSpec(); if( ps.getPathLength( normalString ) > ps.getMaxPathLength() ) { return true; } return elems.stream().filter( el -> ps.getFilenameLength( el ) > ps.getMaxFilenameLength() ).findAny().isPresent(); }
public UnixBuilder<T> hfsPlus() { PathLimits pathLimits = new PathLimits( OS.OSX ); PathSpec pathSpec = new PathSpecOSX(); descr.props.put( Tests10PathWithContent.ONE_CHAR_COUNT, pathLimits.getBigChar() ); descr.props.put( Tests10PathWithContent.MAX_FILENAME_LENGTH, pathSpec.getMaxFilenameLength() ); descr.props.put( Tests10PathWithContent.MAX_PATH_LENGTH, pathSpec.getMaxPathLength() ); descr.props.put( Tests10PathWithContent.GET_FILENAME_LENGTH, (Function<String,Integer>)pathSpec::getFilenameLength ); descr.props.put( Tests10PathWithContent.GET_PATH_LENGTH, (Function<String,Integer>)pathSpec::getPathLength ); descr.addTopic( CaseInsensitive.class ); descr.removeTopic( NotOSX.class ); // todo : is seperator (in a way) return this; }
public UnixBuilder( FSDescription descr, T t ) { super( descr, t ); PathLimits pathLimits = new PathLimits( OS.UNIX ); PathSpec pathSpec = new PathSpecUnix(); descr.props.put( Tests10PathWithContent.ONE_CHAR_COUNT, pathLimits.getBigChar() ); descr.props.put( Tests10PathWithContent.MAX_FILENAME_LENGTH, pathSpec.getMaxFilenameLength() ); descr.props.put( Tests10PathWithContent.MAX_PATH_LENGTH, pathSpec.getMaxPathLength() ); descr.props.put( Tests10PathWithContent.GET_FILENAME_LENGTH, (Function<String,Integer>)pathSpec::getFilenameLength ); descr.props.put( Tests10PathWithContent.GET_PATH_LENGTH, (Function<String,Integer>)pathSpec::getPathLength ); // descr.removeTopic( LimitedPath.class ); theory but linux c limits descr.removeTopic( Windows.class ); descr.removeTopic( DosAttributesT.class ); descr.removeTopic( CaseInsensitive.class ); descr.removeTopic( NonCasePreserving.class ); descr.attributeDescriptions.put( "posix", attributeBuilding( Posix.class, "posix", PosixFileAttributeView.class, PosixFileAttributes.class ). addAttribute( "owner", PosixFileAttributes::owner ). addAttribute( "permissions", PosixFileAttributes::permissions ). addAttribute( "group", PosixFileAttributes::group ). build()); }
public WindowsBuilder( FSDescription descr, T t ) { super( descr, t ); descr.removeTopic( Unix.class ); PathLimits pathLimits = new PathLimits( OS.WINDOWS ); PathSpec pathSpec = new PathSpecWindows(); descr.props.put( Tests10PathWithContent.ONE_CHAR_COUNT, pathLimits.getBigChar() ); descr.props.put( Tests10PathWithContent.MAX_FILENAME_LENGTH, pathSpec.getMaxFilenameLength() ); descr.props.put( Tests10PathWithContent.MAX_PATH_LENGTH, pathSpec.getMaxPathLength() ); descr.props.put( Tests10PathWithContent.GET_FILENAME_LENGTH, (Function<String,Integer>)pathSpec::getFilenameLength ); descr.props.put( Tests10PathWithContent.GET_PATH_LENGTH, (Function<String,Integer>)pathSpec::getPathLength ); descr.removeTopic( Posix.class ); descr.removeTopic( MoveWhile.class ); descr.removeTopic( NonCasePreserving.class ); descr.removeTopic( FileKeyT.class ); descr.props.put( "illegalCharacters", Arrays.asList( ':', '?', '<', '>', '*', '|', '"' )); descr.attributeDescriptions.put( "dos", attributeBuilding( DosAttributesT.class, "dos", DosFileAttributeView.class, DosFileAttributes.class ). addAttribute( "hidden", DosFileAttributes::isHidden ). addAttribute( "archive", DosFileAttributes::isArchive ). addAttribute( "system", DosFileAttributes::isSystem ). addAttribute( "readonly", DosFileAttributes::isReadOnly ). build() ); }