/** * Creates a new data item in the current location. This method must never return null. This method will fail if an * entity with the same name exists in this location. * * @param name the name of the new entity. * @return the newly created entity, never null. * @throws ContentCreationException if the item could not be created. */ public ContentItem createItem( final String name ) throws ContentCreationException { return new DummyContentItem( this, name ); }
/** * Creates a new content location in the current location. This method must never return null. This method will fail * if an entity with the same name exists in this location. * * @param name the name of the new entity. * @return the newly created entity, never null. * @throws ContentCreationException if the item could not be created. */ public ContentLocation createLocation( final String name ) throws ContentCreationException { return new DummyContentLocation( this, name ); }
/** * Returns the mime type for the content entity. If the repository does not store mimetypes, this call usually uses * the repositories MimeRegistry to resolve the mimetype. * * @return the mime type. * @throws ContentIOException if an error occured. */ public String getMimeType() throws ContentIOException { return getRepository().getMimeRegistry().getMimeType( this ); }
/** * Creates a new dummy repository. */ public DummyRepository() { location = new DummyContentLocation( this, "" ); mimeRegistry = new DefaultMimeRegistry(); }