Package org.pentaho.reporting.libraries.repository

Examples of org.pentaho.reporting.libraries.repository.ContentCreationException


    return repository.getMimeRegistry().getMimeType(this);
  }

  public OutputStream getOutputStream() throws ContentIOException, IOException
  {
    throw new ContentCreationException("This repository is read-only");
  }
View Full Code Here


      if (child.length() == 0)
      {
        // probably one of the temp files created by the pentaho-system
        return new FileContentItem(this, child);
      }
      throw new ContentCreationException("File already exists: " + child);
    }
    try
    {
      if (child.createNewFile() == false)
      {
        throw new ContentCreationException("Unable to create the file.");
      }
      return new FileContentItem(this, child);
    }
    catch (IOException e)
    {
      throw new ContentCreationException("IOError while create", e);
    }
  }
View Full Code Here

    final File file = getBackend();
    final File child = new File(file, name);
    if (child.exists())
    {
      throw new ContentCreationException("File already exists.");
    }
    if (child.mkdir() == false)
    {
      throw new ContentCreationException("Unable to create the directory");
    }
    try
    {
      return new FileContentLocation(this, child);
    }
    catch (ContentIOException e)
    {
      throw new ContentCreationException("Failed to create the content-location", e);
    }
  }
View Full Code Here

    return entries.containsKey(name);
  }

  public ContentItem createItem(final String name) throws ContentCreationException
  {
    throw new ContentCreationException();
  }
View Full Code Here

    throw new ContentCreationException();
  }

  public ContentLocation createLocation(final String name) throws ContentCreationException
  {
    throw new ContentCreationException();
  }
View Full Code Here

   */
  public ContentItem createItem(final String name) throws ContentCreationException
  {
    if (entries.containsKey(name))
    {
      throw new ContentCreationException("Entry already exists");
    }

    if (RepositoryUtilities.isInvalidPathName(name))
    {
      throw new ContentCreationException("Entry-Name is not valid");
    }
    final ZipContentItem item = new ZipContentItem(name, repository, this);
    entries.put(name, item);
    return item;
  }
View Full Code Here

  public ContentLocation createLocation(final String name)
      throws ContentCreationException
  {
    if (entries.containsKey(name))
    {
      throw new ContentCreationException("Entry already exists");
    }
    if (RepositoryUtilities.isInvalidPathName(name))
    {
      throw new ContentCreationException("Entry-Name is not valid");
    }

    final ZipContentLocation item = new ZipContentLocation(repository, this, name);
    entries.put(name, item);
    if ("/".equals(this.contentId) == false)
    {
      try
      {
        final ZipEntry entry = new ZipEntry(contentId + name + '/');
        repository.writeDirectory(entry);
      }
      catch (IOException e)
      {
        throw new ContentCreationException("Failed to create directory.", e);
      }
    }
    return item;
  }
View Full Code Here

  public ContentItem createItem(final String name) throws ContentCreationException
  {
    if (entries.containsKey(name))
    {
      throw new ContentCreationException("An entry with name '" + name + "' already exists.");
    }
    if (name.indexOf('/') != -1)
    {
      throw new ContentCreationException("The entry-name '" + name + "' is invalid.");
    }
    if ("".equals(name) || ".".equals(name) || "..".equals(name))
    {
      throw new ContentCreationException("The entry-name '" + name + "' is invalid.");
    }
    final ZipContentItem value = new ZipContentItem(repository, this, name);
    entries.put(name, value);
    return value;
  }
View Full Code Here

  public ContentLocation createLocation(final String name) throws ContentCreationException
  {
    if (entries.containsKey(name))
    {
      throw new ContentCreationException("An entry with name '" + name + "' already exists.");
    }
    if (entries.containsKey(name))
    {
      throw new ContentCreationException("An entry with name '" + name + "' already exists.");
    }
    if (name.indexOf('/') != -1)
    {
      throw new ContentCreationException("The entry-name '" + name + "' is invalid.");
    }
    if ("".equals(name) || ".".equals(name) || "..".equals(name))
    {
      throw new ContentCreationException("The entry-name '" + name + "' is invalid.");
    }
    final ZipContentLocation value = new ZipContentLocation(repository, this, name);
    entries.put(name, value);
    return value;
  }
View Full Code Here

   */
  public ContentItem createItem(final String name) throws ContentCreationException
  {
    if (entries.containsKey(name))
    {
      throw new ContentCreationException("Entry already exists");
    }

    final EmailContentItem item = new EmailContentItem(name, repository, this);
    entries.put(name, item);
    return item;
View Full Code Here

TOP

Related Classes of org.pentaho.reporting.libraries.repository.ContentCreationException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.