/** * Returns an unique name for the given pattern, producing a file relative to the parent file name. The returned path * will be an <b>absolute</b> path starting from the root of the bundle. When linking to this path via href-references * that imply relative paths, use {@link org.pentaho.reporting.libraries.base.util.IOUtils#createRelativePath(java * .lang.String, * java.lang.String)} to transform the absolute path returned here into a path relative to your current context. * * @param bundle the document bundle for which we seek a new unique file name. * @param parent the parent path to which the pattern is relative to. * @param pattern the file name pattern. We expect one parameter only. * @return the unique file name, never null. * @throws IllegalStateException if the first 2 million entries we test do not yield a unique name we can use. */ public static String getUniqueName( final DocumentBundle bundle, final String parent, final String pattern ) { final String fullPattern = IOUtils.getInstance().getAbsolutePath( pattern, parent ); return getUniqueName( bundle, fullPattern ); }
final String name = BundleUtilities.getUniqueName( documentBundle, pattern );
BundleUtilities.getUniqueName( bundle, state.getFileName(), "datasources/external-ds{0}.xml" ); if ( fileName == null ) { throw new IOException( "Unable to generate unique name for External-Data-Source" );
BundleUtilities.getUniqueName( bundle, state.getFileName(), "datasources/direct-static-ds{0}.xml" ); if ( fileName == null ) { throw new IOException( "Unable to generate unique name for the direct Static-Data-Source" );
final String fileName = BundleUtilities.getUniqueName( bundle, state.getFileName(), "datasources/static-ds{0}.xml" ); if ( fileName == null ) { throw new IOException( "Unable to generate unique name for the Named-Static-Data-Source" );
BundleUtilities.getUniqueName( bundle, state.getFileName(), "datasources/compound-ds{0}.xml" ); if ( fileName == null ) { throw new IOException( "Unable to generate unique name for Inline-Data-Source" );
BundleUtilities.getUniqueName( bundle, state.getFileName(), "datasources/sequence-ds{0}.xml" ); if ( fileName == null ) { throw new IOException( "Unable to generate unique name for Sequence-Data-Source" );
BundleUtilities.getUniqueName( bundle, state.getFileName(), "datasources/inline-ds{0}.xml" ); if ( fileName == null ) { throw new IOException( "Unable to generate unique name for Inline-Data-Source" );
BundleUtilities.getUniqueName( bundle, state.getFileName(), "datasources/direct-sql-ds{0}.xml" ); if ( fileName == null ) { throw new IOException( "Unable to generate unique name for SQL-Data-Source" );
final String directory = BundleUtilities.getUniqueName( bundle, absolutePath + "/subreport{0}" ); bundle.createDirectoryEntry( directory, "application/vnd.pentaho.reporting.classic.subreport" ); final String dirRelative = IOUtils.getInstance().createRelativePath( directory, absolutePath + "/." );
final String fileName = BundleUtilities.getUniqueName( bundle, state.getFileName(), "datasources/sql-ds{0}.xml" ); if ( fileName == null ) { throw new IOException( "Unable to generate unique name for SQL-Data-Source" );