Class AbstractFileSystemRepository
- java.lang.Object
-
- nl.goodbytes.xmpp.xep0363.repository.AbstractFileSystemRepository
-
- All Implemented Interfaces:
Repository
- Direct Known Subclasses:
DirectoryRepository,TempDirectoryRepository
public abstract class AbstractFileSystemRepository extends Object implements Repository
A repository of files, backed by a (presumably local) file system.- Author:
- Guus der Kinderen, guus@goodbytes.nl
-
-
Field Summary
Fields Modifier and Type Field Description protected Pathrepository
-
Constructor Summary
Constructors Constructor Description AbstractFileSystemRepository()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description StringcalculateETagHash(SecureUniqueId uuid)booleancontains(SecureUniqueId uuid)protected static longdelete(Path path)booleandelete(SecureUniqueId uuid)voiddestroy()StringgetContentType(SecureUniqueId uuid)InputStreamgetInputStream(SecureUniqueId uuid)OutputStreamgetOutputStream(SecureUniqueId uuid)longgetSize(SecureUniqueId uuid)protected static longgetUsableSpace(Path path)static longgetUsedSpace(Path path)voidinitialize()protected abstract PathinitializeRepository()voidpurge()
-
-
-
Field Detail
-
repository
protected Path repository
-
-
Method Detail
-
initializeRepository
protected abstract Path initializeRepository() throws IOException
- Throws:
IOException
-
initialize
public void initialize() throws IOException- Specified by:
initializein interfaceRepository- Throws:
IOException
-
destroy
public void destroy()
- Specified by:
destroyin interfaceRepository
-
contains
public boolean contains(SecureUniqueId uuid)
- Specified by:
containsin interfaceRepository
-
calculateETagHash
public String calculateETagHash(SecureUniqueId uuid)
- Specified by:
calculateETagHashin interfaceRepository
-
getContentType
public String getContentType(SecureUniqueId uuid)
- Specified by:
getContentTypein interfaceRepository
-
getSize
public long getSize(SecureUniqueId uuid)
- Specified by:
getSizein interfaceRepository
-
getInputStream
public InputStream getInputStream(SecureUniqueId uuid) throws IOException
- Specified by:
getInputStreamin interfaceRepository- Throws:
IOException
-
getOutputStream
public OutputStream getOutputStream(SecureUniqueId uuid) throws IOException
- Specified by:
getOutputStreamin interfaceRepository- Throws:
IOException
-
delete
public boolean delete(SecureUniqueId uuid) throws IOException
- Specified by:
deletein interfaceRepository- Throws:
IOException
-
purge
public void purge() throws IOException- Throws:
IOException
-
getUsableSpace
protected static long getUsableSpace(Path path) throws IOException
- Throws:
IOException
-
getUsedSpace
public static long getUsedSpace(Path path) throws IOException
- Throws:
IOException
-
delete
protected static long delete(Path path) throws IOException
- Throws:
IOException
-
-