Class ClientlibFile
- java.lang.Object
-
- com.composum.sling.clientlibs.handle.ClientlibFile
-
- All Implemented Interfaces:
ClientlibElement
public class ClientlibFile extends Object implements ClientlibElement
Models a file that is referenced by a client library.
-
-
Field Summary
Fields Modifier and Type Field Description FileHandle
handle
Map<String,String>
properties
Additional properties, e.g.
-
Constructor Summary
Constructors Constructor Description ClientlibFile(ClientlibRef ref, Clientlib.Type type, org.apache.sling.api.resource.Resource resource, Map<String,String> properties)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
accept(ClientlibVisitor visitor, ClientlibVisitor.VisitorMode mode, ClientlibResourceFolder parent)
Dispatcher for the appropriate method of visitor: just callsvisitor.visit(this, mode, parent);
.boolean
equals(Object o)
ClientlibRef
getRef()
Clientlib.Type
getType()
The resource-type for which it was created.int
hashCode()
static boolean
isFile(org.apache.sling.api.resource.Resource resource)
ClientlibLink
makeLink()
Creates aClientlibLink
to this element.String
toString()
-
-
-
Field Detail
-
handle
public final FileHandle handle
-
properties
public final Map<String,String> properties
Additional properties, e.g.ClientlibLink.PROP_REL
.
-
-
Constructor Detail
-
ClientlibFile
public ClientlibFile(ClientlibRef ref, Clientlib.Type type, org.apache.sling.api.resource.Resource resource, Map<String,String> properties)
-
-
Method Detail
-
accept
public void accept(ClientlibVisitor visitor, ClientlibVisitor.VisitorMode mode, ClientlibResourceFolder parent) throws IOException, javax.jcr.RepositoryException
Description copied from interface:ClientlibElement
Dispatcher for the appropriate method of visitor: just callsvisitor.visit(this, mode, parent);
.- Specified by:
accept
in interfaceClientlibElement
- Parameters:
visitor
- the visitor we want to dispatch tomode
- processing modeparent
- if applicable, the parent of the visited resource- Throws:
IOException
javax.jcr.RepositoryException
-
isFile
public static boolean isFile(org.apache.sling.api.resource.Resource resource)
-
makeLink
public ClientlibLink makeLink()
Description copied from interface:ClientlibElement
Creates aClientlibLink
to this element.- Specified by:
makeLink
in interfaceClientlibElement
-
getRef
public ClientlibRef getRef()
Description copied from interface:ClientlibElement
Returns aClientlibRef
ClientlibRef.isSatisfiedby(ClientlibLink)
ClientlibElement.makeLink()
. This is either a fresh one, or, in case of files, the one with which the file was located.- Specified by:
getRef
in interfaceClientlibElement
-
getType
public Clientlib.Type getType()
Description copied from interface:ClientlibElement
The resource-type for which it was created.- Specified by:
getType
in interfaceClientlibElement
-
-