/* * [SortAliases.java] * * Summary: sorts the various alias comments after a htmlDirs = Global.configuration.getDirsContainingHTMLMacros(); final String[] args = new String[ htmlDirs.size() + 1 ]; args[ 0 ] = "-q"; int i = 1; final String localWebrootDir = Global.configuration.getLocalWebrootWithBackslashes(); for ( String aDir : htmlDirs ) { args[ i++ ] = localWebrootDir + "\\" + aDir; } filesToProcess = new CommandLine( args, new AllButFootDirectoriesFilter(), new ExtensionListFilter( ExtensionListFilter.COMMON_HTML_EXTENSIONS ) ); }// /method /** * debugging tool to display long strings * * @param s the string. */ private static void showAbbreviated( String s ) { if ( DEBUGGING ) { out.println( "length:" + s.length() ); if ( s.length() > 600 ) { out.println( s.substring( 0, 300 ) ); out.println( " ..." ); out.println( " " + s.substring( s.length() - 300 ) ); } else { out.println( s ); } } }// /method /** * sort the various alias comments in the
...
*/ private static void sortAliasesInOneFile( File fileBeingProcessed ) throws IOException { final String original = HunkIO.readEntireFile( fileBeingProcessed, HunkIO.UTF8 ); final int dtPlace = original.indexOf( "
", dtPlace ); if ( slashDtPlace < 0 ) { return; } final String fatBand = original.substring( dtPlace, slashDtPlace ); final int firstAlias = fatBand.indexOf( "" ); if ( last < 0 ) { err.println( "unstructured dt comments in " + EIO.getCanOrAbsPath( fileBeingProcessed ) ); return; } final String sortableBand = fatBand.substring( first, last + 4 ); if ( DEBUGGING ) { out.println( EIO.getCanOrAbsPath( fileBeingProcessed ) + " : " + sortableBand ); } final String sorted = SortCode.sortContents( sortableBand, null /* startMarker */, " -->" /* marker */, null /* endMarker */, null /* string comparator */, "case-sensitive", "