// doesn't prompt with 'unable to write'
IFolder referencePkgFolder = getProjectService().getReferencedPackagesFolder(project);
Utils.adjustResourceReadOnly(referencePkgFolder, false, true);
monitorCheck(monitor);
RetrieveResultExt retrieveResultHandler = null;
try {
retrieveResultHandler =
getServiceLocator().getPackageRetrieveService().retrieveManagedInstalledPackages(project, monitor);
} catch (ServiceTimeoutException ex) {
retrieveResultHandler =
getServiceLocator().getPackageRetrieveService().handleRetrieveServiceTimeoutException(ex, OPERATION,
monitor);
if (retrieveResultHandler != null) {
Connection connection = getConnectionFactory().getConnection(project);
ProjectPackageList projectPackageList =
getProjectPackageFactory().getManagedInstalledProjectPackages(connection);
if (projectPackageList != null) {
projectPackageList.setProject(project);
}
retrieveResultHandler.setProjectPackageList(projectPackageList);
}
}
if (retrieveResultHandler == null) {
logger.warn("Unable to refresh installed packages - retrieve result is null");
return false;
}
if (retrieveResultHandler.getZipFileCount() == 0) {
return true;
}
if (Utils.isNotEmpty(retrieveResultHandler.getProjectPackageList())) {
retrieveResultHandler.getProjectPackageList().setProject(project);
}
monitorCheck(monitor);
return getProjectService().handleRetrieveResult(retrieveResultHandler.getProjectPackageList(),
retrieveResultHandler, true, null, monitor);
}