congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
PathSpecWindows
Code IndexAdd Tabnine to your IDE (free)

How to use
PathSpecWindows
in
de.pfabulist.kleinod.nio

Best Java code snippets using de.pfabulist.kleinod.nio.PathSpecWindows (Showing top 5 results out of 315)

origin: de.pfabulist.kleinod/kleinod-nio

@Override
public int compareTo( String a, String b ) {
  return getNormalForm( a ).compareTo( getNormalForm( b ) );
}
origin: de.pfabulist.lindwurm/memoryfs

public static MemoryFSBuilder windows() {
  return new MemoryFSBuilder().
      pathSpec( new PathSpecWindows() ).
      primaryStoreName( "c:").
      attributeView( DosFileAttributeView.class );
}
origin: de.pfabulist.lindwurm/niotest

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() );
}
origin: de.pfabulist.kleinod/kleinod-nio

static PathSpec byOS( OS os ) {
  if ( os.isWindows() ) {
    return new PathSpecWindows();
  }
  if ( os.isOSX() ) {
    return new PathSpecOSX();
  }
  if ( os.isUnix() ) {
    return new PathSpecUnix();
  }
  return new PathSpecDefault();
}
origin: de.pfabulist.kleinod/kleinod-nio

@Override
public RC getRootComponent( String str ) {
  if( drives.matcher( str ).matches() ) {
    return new RC( Optional.of( getNormalForm( str.substring( 0, 2 ) ) ), str.substring( 2 ) );
  }
  if ( !doubleSlashStart.matcher( str ).matches() ) {
    return new RC( Optional.empty(), str ); // relative path or single slash
  }
  Matcher matcher = unc.matcher( str );
  if( !matcher.matches() ) {
    throw new InvalidPathException( str, "illegal path (not unc)" );
  }
  String path   = Optional.ofNullable( matcher.group( UNCPATH )).orElseThrow( () -> new IllegalStateException( "bad group name" ));
  String server = getNormalForm( Optional.ofNullable( matcher.group( UNCSERVER )).orElseThrow( () -> new IllegalStateException( "bad group name" )));
  String share  = getNormalForm( Optional.ofNullable( matcher.group( UNCSHARE )).orElseThrow( () -> new IllegalStateException( "bad group name" )));
  return new RC( Optional.of( "\\\\" + server + "\\" + share ),
          path.isEmpty() ? "\\" : path );
}
de.pfabulist.kleinod.nioPathSpecWindows

Javadoc

Copyright (c) 2006 - 2016, Stephan Pfab SPDX-License-Identifier: BSD-2-Clause

Most used methods

  • <init>
  • getNormalForm

Popular in Java

  • Making http requests using okhttp
  • setScale (BigDecimal)
  • runOnUiThread (Activity)
  • putExtra (Intent)
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • StringTokenizer (java.util)
    Breaks a string into tokens; new code should probably use String#split.> // Legacy code: StringTo
  • ImageIO (javax.imageio)
  • JOptionPane (javax.swing)
  • Top 17 Free Sublime Text Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now