public class ImportMigrationExternalEntryImpl extends ImportMigrationEntryImpl
ImportMigrationEntry
representing an external file that was exported.restored
METADATA_CHECKSUM, METADATA_FILES, METADATA_FILTERED, METADATA_FOLDER, METADATA_LAST_MODIFIED, METADATA_NAME, METADATA_PROPERTY, METADATA_REFERENCE, METADATA_SOFTLINK
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o)
The superclass implementation is sufficient for our needs.
|
protected Optional<InputStream> |
getInputStream(boolean checkAccess) |
long |
getLastModifiedTime()
Gets the last modification time of the entry.
|
int |
hashCode()
The superclass implementation is sufficient for our needs.
|
boolean |
restore(boolean required)
Restores this entry's content underneath the distribution root directory based on this entry's
path which can include sub-directories.
|
boolean |
restore(boolean required,
PathMatcher filter)
Restores all entries that recursively match the provided path filter underneath the
distribution root directory based on this entry's path which can include sub-directories.
|
protected String |
toDebugString()
Gets a debug string to represent this entry.
|
getAbsolutePath, getContext, getFile, getInputStream, getName, getPath, getPropertyReferencedEntry, getReport, isDirectory, isFile, restore
compareTo, getId, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
restore, restore
getId
compareTo
public long getLastModifiedTime()
MigrationEntry
getLastModifiedTime
in interface MigrationEntry
getLastModifiedTime
in class ImportMigrationEntryImpl
public boolean restore(boolean required)
ImportMigrationEntry
This entry's sub-directories (if any) will be created if they don't already exist. The destination file will be overwritten if it already exists.
All errors and warnings are automatically recorded with the associated migration report.
Errors can be reported in two ways:
MigrationException
(e.g. failure to write to the exported file)
false
is returned from this method. This allows for the accumulation of as many issues
as possible to report to the user before aborting the operation.
Note: If this entry represents a directory which had been completely exported using
ExportMigrationEntry.store()
or ExportMigrationEntry.store(boolean)
then in
addition to restoring all entries recursively, calling this method will also remove any
existing files or directories that were not on the original system.
Note: Calling restore()
twice will not restore the entry two times. The
second time it is called, the same result will be returned as the first time no matter which
restore()
method was called.
restore
in interface ImportMigrationEntry
restore
in class ImportMigrationEntryImpl
required
- true
if the file or directory is required to exist in the export
and if it doesn't an error should be recorded; false
if the file or directory
is optional and may not be exported in which case calling this method will do nothingtrue
if no errors were recorded as a result of processing this command;
false
otherwisepublic boolean restore(boolean required, PathMatcher filter)
ImportMigrationEntry
required
parameter is interpreted for recording errors and deciding what to return.
This entry's sub-directories (if any) will be created if they don't already exist. The destination file will be overwritten if it already exists.
All errors and warnings are automatically recorded with the associated migration report.
Errors can be reported in two ways:
MigrationException
(e.g. failure to write to the exported file)
false
is returned from this method. This allows for the accumulation of as many issues
as possible to report to the user before aborting the operation.
Note: Calling restore()
twice will not restore the entry two times. The
second time it is called, the same result will be returned as the first time no matter which
restore()
method was called.
restore
in interface ImportMigrationEntry
restore
in class ImportMigrationEntryImpl
required
- true
if the file or directory is required to exist in the export
and if it doesn't an error should be recorded; false
if the file or directory
is optional and may not be exported in which case calling this method will do nothingfilter
- the path filter to usetrue
if no errors were recorded as a result of processing this command;
false
otherwiseprotected Optional<InputStream> getInputStream(boolean checkAccess) throws IOException
getInputStream
in class ImportMigrationEntryImpl
IOException
protected String toDebugString()
ImportMigrationEntryImpl
toDebugString
in class ImportMigrationEntryImpl
public boolean equals(Object o)
equals
in class ImportMigrationEntryImpl
o
- the object to checkpublic int hashCode()
hashCode
in class ImportMigrationEntryImpl
This work is licensed under a Creative Commons Attribution 4.0 International License.