Search in sources :

Example 6 with ActionInstance

use of com.manydesigns.portofino.resourceactions.ActionInstance in project Portofino by ManyDesigns.

the class ActionsAction method delete.

@DELETE
public void delete() throws Exception {
    String actionPath = StringUtils.join(parameters, "/");
    ActionInstance actionInstance = getPageInstance(actionPath);
    FileObject directory = actionInstance.getDirectory();
    if (!directory.exists()) {
        throw new WebApplicationException(Response.Status.NOT_FOUND);
    }
    directory.deleteAll();
}
Also used : ActionInstance(com.manydesigns.portofino.resourceactions.ActionInstance) FileObject(org.apache.commons.vfs2.FileObject)

Aggregations

ActionInstance (com.manydesigns.portofino.resourceactions.ActionInstance)6 FileObject (org.apache.commons.vfs2.FileObject)4 ActionDescriptor (com.manydesigns.portofino.actions.ActionDescriptor)3 AbstractResourceAction (com.manydesigns.portofino.resourceactions.AbstractResourceAction)2 ActionContext (com.manydesigns.portofino.resourceactions.ActionContext)2 ResourceAction (com.manydesigns.portofino.resourceactions.ResourceAction)2 FileBlob (com.manydesigns.elements.annotations.FileBlob)1 Blob (com.manydesigns.elements.blobs.Blob)1 HierarchicalBlobManager (com.manydesigns.elements.blobs.HierarchicalBlobManager)1 AbstractBlobField (com.manydesigns.elements.fields.AbstractBlobField)1 Field (com.manydesigns.elements.fields.Field)1 FileBlobField (com.manydesigns.elements.fields.FileBlobField)1 ClassAccessor (com.manydesigns.elements.reflection.ClassAccessor)1 MutableHttpServletRequest (com.manydesigns.elements.servlet.MutableHttpServletRequest)1 Annotation (com.manydesigns.portofino.model.Annotation)1 Property (com.manydesigns.portofino.model.Property)1 Column (com.manydesigns.portofino.model.database.Column)1 ConfigurationWithDefaults (com.manydesigns.portofino.resourceactions.ConfigurationWithDefaults)1 CrudProperty (com.manydesigns.portofino.resourceactions.crud.configuration.CrudProperty)1 CrudConfiguration (com.manydesigns.portofino.resourceactions.crud.configuration.database.CrudConfiguration)1