* Extracts flags from a resource collection.
*/
protected ResourceCollectionFlags getFlags(ResourceCollection rc) {
if (rc instanceof ArchiveFileSet) {
if (rc instanceof ArFileSet) {
ArFileSet ar = (ArFileSet) rc;
return new ResourceCollectionFlags(ar.getPrefix(getProject()),
ar.getFullpath(getProject()),
ar.hasFileModeBeenSet()
? ar.getFileMode(getProject())
: -1,
ar.hasDirModeBeenSet()
? ar.getDirMode(getProject())
: -1,
ar.hasUserIdBeenSet()
? ar.getUid()
: EntryHelper.UNKNOWN_ID,
ar.hasGroupIdBeenSet()
? ar.getGid()
: EntryHelper.UNKNOWN_ID);
} else if (rc instanceof CpioFileSet) {
CpioFileSet cr = (CpioFileSet) rc;
return new ResourceCollectionFlags(cr.getPrefix(getProject()),
cr.getFullpath(getProject()),
cr.hasFileModeBeenSet()
? cr.getFileMode(getProject())
: -1,
cr.hasDirModeBeenSet()
? cr.getDirMode(getProject())
: -1,
cr.hasUserIdBeenSet()
? cr.getUid()
: EntryHelper.UNKNOWN_ID,
cr.hasGroupIdBeenSet()
? cr.getGid()
: EntryHelper.UNKNOWN_ID);
} else if (rc instanceof TarFileSet) {
TarFileSet tr = (TarFileSet) rc;
return new ResourceCollectionFlags(tr.getPrefix(getProject()),
tr.getFullpath(getProject()),
tr.hasFileModeBeenSet()
? tr.getFileMode(getProject())
: -1,
tr.hasDirModeBeenSet()
? tr.getDirMode(getProject())
: -1,
tr.hasUserIdBeenSet()
? tr.getUid()
: EntryHelper.UNKNOWN_ID,
tr.hasGroupIdBeenSet()
? tr.getGid()
: EntryHelper.UNKNOWN_ID,
tr.hasUserNameBeenSet()
? tr.getUserName() : null,
tr.hasGroupBeenSet()
? tr.getGroup() : null);
} else if (rc instanceof
org.apache.tools.ant.types.TarFileSet) {
org.apache.tools.ant.types.TarFileSet tr =
(org.apache.tools.ant.types.TarFileSet) rc;
return new ResourceCollectionFlags(tr.getPrefix(getProject()),
tr.getFullpath(getProject()),
tr.hasFileModeBeenSet()
? tr.getFileMode(getProject())
: -1,
tr.hasDirModeBeenSet()
? tr.getDirMode(getProject())
: -1,
tr.hasUserIdBeenSet()
? tr.getUid()
: EntryHelper.UNKNOWN_ID,
tr.hasGroupIdBeenSet()
? tr.getGid()
: EntryHelper.UNKNOWN_ID,
tr.hasUserNameBeenSet()
? tr.getUserName() : null,
tr.hasGroupBeenSet()
? tr.getGroup() : null);
} else {
ArchiveFileSet ar = (ArchiveFileSet) rc;
return new ResourceCollectionFlags(ar.getPrefix(getProject()),
ar.getFullpath(getProject()),
ar.hasFileModeBeenSet()
? ar.getFileMode(getProject())
: -1,
ar.hasDirModeBeenSet()
? ar.getDirMode(getProject())
: -1);
}
}
return new ResourceCollectionFlags();
}