org.javaswift.joss.client.website
Class AbstractWebsite

java.lang.Object
  extended by org.javaswift.joss.client.core.AbstractObjectStoreEntity<ContainerInformation>
      extended by org.javaswift.joss.client.core.AbstractContainer
          extended by org.javaswift.joss.client.website.AbstractWebsite
All Implemented Interfaces:
Comparable<Container>, Container, ListHolder<StoredObject>, ListSubject, ObjectStoreEntity, Website
Direct Known Subclasses:
WebsiteImpl, WebsiteMock

public abstract class AbstractWebsite
extends AbstractContainer
implements Website


Field Summary
 
Fields inherited from class org.javaswift.joss.client.core.AbstractContainer
LOG, name
 
Fields inherited from class org.javaswift.joss.client.core.AbstractObjectStoreEntity
ALLOW_CACHING, info, staleHeaders
 
Constructor Summary
AbstractWebsite(Account account, String name, boolean allowCaching)
           
 
Method Summary
 Website create()
          Creates a Container in the Account.
 StoredObject getErrorPage()
          Gets the error page of the website.
protected  Object getHeader(String metadataHeaderName)
           
 String getHost()
          Get the original host, which is a combination of the container and the original (non-configured) public host.
 StoredObject getIndexPage()
          Gets the index page of the website.
 StoredObject getListingCSS()
          Gets the CSS file to use for adding layout to the file listing.
 String getMetadataHeader(String websiteHeader)
           
protected  StoredObject getStoredObject(String metadataHeaderName)
           
 boolean isListing()
          If this value is true, the site will be shown as a file listing instead of a regular website
 void pullDirectory(File directory)
          Compares a local directory to the contents of the Container on the basis of MD5 hashes (ie, Etag).
 void pushDirectory(File directory)
          Compares a local directory to the contents of the Container on the basis of MD5 hashes (ie, Etag).
 void setErrorPage(StoredObject errorPage)
          Gets the error page of the website.
protected  void setHeader(WebsiteHeader header)
           
 Website setIgnoreFilters(String[] ignoreFilters)
          Passes a number of files and directories that must be ignored by the push/pull mechanism.
 void setIndexPage(StoredObject indexPage)
          Sets the index page of the website.
 void setListing(boolean listing)
          Sets whether the container must be shown as a listing.
 void setListingCSS(StoredObject listingCSS)
          Sets the CSS file to use for adding layout to the listing.
protected  void syncDirectory(FileObjects source, FileObjects target)
           
 
Methods inherited from class org.javaswift.joss.client.core.AbstractContainer
compareTo, createMetadataEntry, delete, equals, getAccount, getBytesUsed, getContainerReadPermission, getcontainerWritePermission, getCount, getFactory, getFormPost, getInfo, getMaxPageSize, getName, getObjectSegment, getPaginationMap, getPaginationMap, getPathForEntity, hashCode, isPublic, list, list, list, makePrivate, makePublic, metadataSetFromHeaders, saveSpecificMetadata, setBytesUsed, setContainerRights, setContainerRights, setCount, uploadSegmentedObjects
 
Methods inherited from class org.javaswift.joss.client.core.AbstractObjectStoreEntity
checkForInfo, checkForInfo, checkForInfoAndAllowHeaderSet, checkForInfoDisallowErrorLog, exists, getMetadata, getMetadata, getPath, invalidate, isAllowCaching, isInfoRetrieved, isStale, reload, removeAndDoNotSaveMetadata, removeAndSaveMetadata, saveMetadata, setAndDoNotSaveMetadata, setAndSaveMetadata, setInfoRetrieved, setMetadata
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.javaswift.joss.model.Container
delete, exists, getAccount, getBytesUsed, getContainerReadPermission, getcontainerWritePermission, getCount, getFormPost, getObject, getObjectSegment, isInfoRetrieved, isPublic, makePrivate, makePublic, reload, setBytesUsed, setContainerRights, setCount
 
Methods inherited from interface org.javaswift.joss.model.ObjectStoreEntity
getMetadata, getMetadata, getPath, removeAndDoNotSaveMetadata, removeAndSaveMetadata, saveMetadata, setAndDoNotSaveMetadata, setAndSaveMetadata, setMetadata
 
Methods inherited from interface java.lang.Comparable
compareTo
 
Methods inherited from interface org.javaswift.joss.model.ListHolder
getMaxPageSize, getPaginationMap, getPaginationMap, list, list, list
 
Methods inherited from interface org.javaswift.joss.model.ListSubject
getName, metadataSetFromHeaders
 

Constructor Detail

AbstractWebsite

public AbstractWebsite(Account account,
                       String name,
                       boolean allowCaching)
Method Detail

setIgnoreFilters

public Website setIgnoreFilters(String[] ignoreFilters)
Description copied from interface: Website
Passes a number of files and directories that must be ignored by the push/pull mechanism. Use normal path notation using the root directory as the root path.

Specified by:
setIgnoreFilters in interface Website
Parameters:
ignoreFilters - files/directories to be ignored
Returns:
instance of Website

create

public Website create()
Description copied from interface: Container
Creates a Container in the Account.

Specified by:
create in interface Container
Overrides:
create in class AbstractContainer

getHeader

protected Object getHeader(String metadataHeaderName)

getStoredObject

protected StoredObject getStoredObject(String metadataHeaderName)

setHeader

protected void setHeader(WebsiteHeader header)

getMetadataHeader

public String getMetadataHeader(String websiteHeader)

getIndexPage

public StoredObject getIndexPage()
Description copied from interface: Website
Gets the index page of the website. This is the page that is shown by default

Specified by:
getIndexPage in interface Website
Returns:
index page of the website

getErrorPage

public StoredObject getErrorPage()
Description copied from interface: Website
Gets the error page of the website. This is the page that is shown when an error occurs

Specified by:
getErrorPage in interface Website
Returns:
error page of the website

getListingCSS

public StoredObject getListingCSS()
Description copied from interface: Website
Gets the CSS file to use for adding layout to the file listing. Only used if the site is shown as a listing

Specified by:
getListingCSS in interface Website
Returns:
the CSS file to use for the listing

isListing

public boolean isListing()
Description copied from interface: Website
If this value is true, the site will be shown as a file listing instead of a regular website

Specified by:
isListing in interface Website
Returns:
whether the site should be shown as a listing

setIndexPage

public void setIndexPage(StoredObject indexPage)
Description copied from interface: Website
Sets the index page of the website. This is the page that is shown by default

Specified by:
setIndexPage in interface Website
Parameters:
indexPage - index page of the website

setErrorPage

public void setErrorPage(StoredObject errorPage)
Description copied from interface: Website
Gets the error page of the website. This is the page that is shown when an error occurs

Specified by:
setErrorPage in interface Website
Parameters:
errorPage - error page of the website

setListingCSS

public void setListingCSS(StoredObject listingCSS)
Description copied from interface: Website
Sets the CSS file to use for adding layout to the listing. Only used if the Container is a listing.

Specified by:
setListingCSS in interface Website
Parameters:
listingCSS - CSS file

setListing

public void setListing(boolean listing)
Description copied from interface: Website
Sets whether the container must be shown as a listing. If false, the container acts as a static website. The default is false

Specified by:
setListing in interface Website
Parameters:
listing - true, the container is a listing, false, the container is static website

pushDirectory

public void pushDirectory(File directory)
Description copied from interface: Website
Compares a local directory to the contents of the Container on the basis of MD5 hashes (ie, Etag). It makes a couple of potentially far-reaching decision, so be careful:

Specified by:
pushDirectory in interface Website
Parameters:
directory - the directory to check against the Container's content

pullDirectory

public void pullDirectory(File directory)
Description copied from interface: Website
Compares a local directory to the contents of the Container on the basis of MD5 hashes (ie, Etag). It makes a couple of potentially far-reaching decision, so be careful:

Specified by:
pullDirectory in interface Website
Parameters:
directory - the directory to check against the Container's content

syncDirectory

protected void syncDirectory(FileObjects source,
                             FileObjects target)

getHost

public String getHost()
Description copied from interface: Website
Get the original host, which is a combination of the container and the original (non-configured) public host. This host can be used to configure a CNAME in your DNS settings.

Specified by:
getHost in interface Website
Returns:
host of the website


Copyright © 2012-2014 42 BV. All Rights Reserved.