/** * Generates a new, unique name for storing resources in the output repository. Assuming that proper synchronization * has been applied, the generated name will be unique within that repository. * * @param nameHint a user defined name for that resource. * @param mimeType the mime type of the resource to be stored in the repository. * @return the generated, fully qualified name. */ public String generateName( final String nameHint, final String mimeType ) throws ContentIOException { final String name; if ( nameHint != null ) { name = nameHint; } else { name = defaultNameHint; } final String suffix; if ( defaultSuffix != null ) { suffix = defaultSuffix; } else { suffix = getSuffixForType( mimeType, location ); } final String filename = name + '-' + counter + '.' + suffix; if ( location.exists( filename ) == false ) { counter += 1; return filename; } throw new ContentIOException( "Unable to generate page-sequence: A file with the next expected name already exists." ); }
for ( int i = 0; i < length - 1; i++ ) { final String nameItem = name[ i ]; if ( node.exists( nameItem ) == false ) {
for ( int i = 0; i < length - 1; i++ ) { final String nameItem = name[ i ]; if ( node.exists( nameItem ) == false ) {