public class FileSystemSyncEndpoint extends Object implements SyncEndpoint
| Constructor and Description |
|---|
FileSystemSyncEndpoint(File syncToDir,
boolean syncDeletes)
Creates a SyncEnpoint pointing to a directory on the local file system
where files will be synced to.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addEndPointListener(EndPointListener listener)
Registers a listener
|
void |
deleteContent(String spaceId,
String contentId)
Removes content from the endpoint.
|
Iterator<String> |
getFilesList()
Retrieves a listing of all files available at the endpoint.
|
protected File |
getSyncToFile(MonitoredFile syncFile,
File watchDir) |
void |
removeEndPointListener(EndPointListener listener)
Unregisters a listener
|
boolean |
syncFile(MonitoredFile syncFile,
File watchDir)
Ensures that the endpoint includes a file equivalent to the provided
local file:
- If the local file exists but no file with the same path exists at
the endpoint, the local file will be copied to the endpoint
- If the local file exists and is different from a file with the same
path at the endpoint, the local file will replace the file at the
endpoint.
|
SyncResultType |
syncFileAndReturnDetailedResult(MonitoredFile monitoredFile,
File watchDir)
An alternate form of the syncFile method that returns a more nuanced result.
|
public FileSystemSyncEndpoint(File syncToDir, boolean syncDeletes)
syncToDir - public boolean syncFile(MonitoredFile syncFile, File watchDir)
SyncEndpointsyncFile in interface SyncEndpointsyncFile - local file to sync with the endpointwatchDir - the directory under watch in which this file residespublic SyncResultType syncFileAndReturnDetailedResult(MonitoredFile monitoredFile, File watchDir)
SyncEndpointsyncFileAndReturnDetailedResult in interface SyncEndpointprotected File getSyncToFile(MonitoredFile syncFile, File watchDir)
public Iterator<String> getFilesList()
SyncEndpointgetFilesList in interface SyncEndpointpublic void addEndPointListener(EndPointListener listener)
SyncEndpointaddEndPointListener in interface SyncEndpointpublic void removeEndPointListener(EndPointListener listener)
SyncEndpointremoveEndPointListener in interface SyncEndpointpublic void deleteContent(String spaceId, String contentId)
SyncEndpointdeleteContent in interface SyncEndpointCopyright © 2009–2017 DuraSpace. All rights reserved.