if (logger.isDebugEnabled()) {
logger.debug("Retrieving selective component types for given packages from " + connection.getLogDisplay());
}
RetrieveRequest retrieveRequest = getRetrieveRequest();
retrieveRequest.setPackageNames(projectPackageList.getNamedPackageNames());
IProject project = projectPackageList.getProject();
Package packageManifest = null;
// using setSpecificFile machanism to refresh component folder(s) when component type(s) has associated
// component type. Otherwise, refresh using sub-stanzas of package.xml
if (projectPackageList.hasPackage(Constants.DEFAULT_PACKAGED_NAME)) {
if (hasComponentTypeWthAssociatedComponentTypes(componentTypes)) {
String[] filePaths = getFilePathsByComponentTypes(project, connection, componentTypes);
if (logger.isDebugEnabled()) {
logRefreshFilePaths(filePaths);
}
if (Utils.isNotEmpty(filePaths)) {
retrieveRequest.setSpecificFiles(filePaths);
}
if (projectPackageList.hasPackage(Constants.DEFAULT_PACKAGED_NAME)) {
if (logger.isDebugEnabled()) {
logger.debug("Include retrieval of default package manifest");
}
packageManifest = getPackageManifestFactory().getDefaultPackageManifest(projectPackageList);
}
} else {
if (logger.isDebugEnabled()) {
logger.debug("Include retrieval of subset of stanzas from default package manifest");
}
packageManifest =
getPackageManifestFactory().getPackageManifestForComponentTypes(project,
Constants.DEFAULT_PACKAGED_NAME, componentTypes, true);
}
retrieveRequest.setUnpackaged(getPackageManifestFactory().convert(packageManifest));
}
RetrieveResultExt retrieveResultExt = retrieveWork(connection, retrieveRequest, monitor);
retrieveResultExt.setProjectPackageList(projectPackageList);
return retrieveResultExt;