Index: kernel/kernel-impl/src/main/java/org/sakaiproject/content/impl/BaseContentService.java =================================================================== --- kernel/kernel-impl/src/main/java/org/sakaiproject/content/impl/BaseContentService.java (revision 121531) +++ kernel/kernel-impl/src/main/java/org/sakaiproject/content/impl/BaseContentService.java (working copy) @@ -6751,7 +6751,8 @@ try { // use the helper - CollectionAccessFormatter.format(collection, ref, req, res, rb, getAccessPoint(true), getAccessPoint(false)); + CollectionAccessFormatter.format(collection, ref, req, res, rb, getAccessPoint(true), getAccessPoint(false), this, + m_siteService); // track event // eventTrackingService.post(eventTrackingService.newEvent(EVENT_RESOURCE_READ, collection.getReference(), false)); @@ -13462,7 +13463,7 @@ ZipContentUtil extractZipArchive = new ZipContentUtil(); // KNL-900 Total size of files should be checked before unzipping (KNL-273) - Map zipManifest = extractZipArchive.getZipManifest(resourceId); + Map zipManifest = extractZipArchive.getZipManifest(resourceId); if (zipManifest == null) { M_log.error("Zip file for resource ("+resourceId+") has no zip manifest, cannot extract"); } else if (zipManifest.size() >= maxZipExtractSize) { @@ -13485,7 +13486,7 @@ throw new OverQuotaException(resource.getReference()); } // zip files are not too large to extract so do the extract - extractZipArchive.extractArchive(resourceId); + extractZipArchive.extractArchive(resourceId); } } Index: kernel/kernel-impl/src/main/java/org/sakaiproject/content/impl/CollectionAccessFormatter.java =================================================================== --- kernel/kernel-impl/src/main/java/org/sakaiproject/content/impl/CollectionAccessFormatter.java (revision 120522) +++ kernel/kernel-impl/src/main/java/org/sakaiproject/content/impl/CollectionAccessFormatter.java (working copy) @@ -35,16 +35,15 @@ import org.sakaiproject.component.cover.ServerConfigurationService; import org.sakaiproject.content.api.ContentCollection; import org.sakaiproject.content.api.ContentEntity; -import org.sakaiproject.content.cover.ContentHostingService; +import org.sakaiproject.content.api.ContentHostingService; import org.sakaiproject.entity.api.Entity; import org.sakaiproject.entity.api.Reference; import org.sakaiproject.entity.api.ResourceProperties; import org.sakaiproject.exception.IdUnusedException; import org.sakaiproject.site.api.Site; -import org.sakaiproject.site.cover.SiteService; +import org.sakaiproject.site.api.SiteService; import org.sakaiproject.user.api.User; import org.sakaiproject.user.api.UserNotDefinedException; -import org.sakaiproject.user.cover.UserDirectoryService; import org.sakaiproject.util.ResourceLoader; import org.sakaiproject.util.Validator; @@ -63,11 +62,11 @@ * Format the collection as an HTML display. */ @SuppressWarnings({ "unchecked" }) - public static void format(ContentCollection x, Reference ref, HttpServletRequest req, HttpServletResponse res, - ResourceLoader rb, String accessPointTrue, String accessPointFalse) + public static void format(ContentCollection x, Reference ref, HttpServletRequest req, HttpServletResponse res, ResourceLoader rb, + String accessPointTrue, String accessPointFalse, ContentHostingService contentHostingService, SiteService siteService) { // do not allow directory listings for /attachments and its subfolders - if(ContentHostingService.isAttachmentResource(x.getId())) + if (contentHostingService.isAttachmentResource(x.getId())) { try { @@ -106,7 +105,7 @@ if (parts.length > 1) { String siteId = parts[1]; try { - Site site = SiteService.getSite(siteId); + Site site = siteService.getSite(siteId); if (site.getSkin() != null) { skinName = site.getSkin(); } @@ -181,11 +180,11 @@ // These both perform the same check in the implementation but we should observe the API. // This also checks to see if a resource is hidden or time limited. if ( isCollection) { - if (!ContentHostingService.allowGetCollection(xs)) { + if (!contentHostingService.allowGetCollection(xs)) { continue; } } else { - if (!ContentHostingService.allowGetResource(xs)) { + if (!contentHostingService.allowGetResource(xs)) { continue; } } @@ -273,19 +272,22 @@ } } + /** + * @deprecated - no references to this method found + */ protected static User getUserProperty(ResourceProperties props, String name) { - String id = props.getProperty(name); - if (id != null) - { - try - { - return UserDirectoryService.getUser(id); - } - catch (UserNotDefinedException e) - { - } - } + // String id = props.getProperty(name); + // if (id != null) + // { + // try + // { + // return UserDirectoryService.getUser(id); + // } + // catch (UserNotDefinedException e) + // { + // } + // } return null; } Index: kernel/kernel-impl/src/test/java/org/sakaiproject/content/impl/test/ContentHostingServiceTest.java =================================================================== --- kernel/kernel-impl/src/test/java/org/sakaiproject/content/impl/test/ContentHostingServiceTest.java (revision 120522) +++ kernel/kernel-impl/src/test/java/org/sakaiproject/content/impl/test/ContentHostingServiceTest.java (working copy) @@ -62,8 +62,8 @@ * Checks the resources of zero bytes are handled correctly. */ public void testEmptyResources() throws Exception { - ContentHostingService ch = org.sakaiproject.content.cover.ContentHostingService.getInstance(); - SessionManager sm = org.sakaiproject.tool.cover.SessionManager.getInstance(); + ContentHostingService ch = getService(ContentHostingService.class); + SessionManager sm = getService(SessionManager.class); Session session = sm.getCurrentSession(); session.setUserEid("admin"); session.setUserId("admin"); @@ -95,8 +95,8 @@ public void testSaveRetriveFolder() { - ContentHostingService ch = org.sakaiproject.content.cover.ContentHostingService.getInstance(); - SessionManager sm = org.sakaiproject.tool.cover.SessionManager.getInstance(); + ContentHostingService ch = getService(ContentHostingService.class); + SessionManager sm = getService(SessionManager.class); Session session = sm.getCurrentSession(); session.setUserEid("admin"); session.setUserId("admin"); @@ -183,8 +183,8 @@ */ public void testUtfFolders() { //lets test saving a utf8 - ContentHostingService ch = org.sakaiproject.content.cover.ContentHostingService.getInstance(); - SessionManager sm = org.sakaiproject.tool.cover.SessionManager.getInstance(); + ContentHostingService ch = getService(ContentHostingService.class); + SessionManager sm = getService(SessionManager.class); Session session = sm.getCurrentSession(); session.setUserEid("admin"); session.setUserId("admin"); @@ -249,8 +249,8 @@ public void testDeleteResource() { - ContentHostingService ch = org.sakaiproject.content.cover.ContentHostingService.getInstance(); - SessionManager sm = org.sakaiproject.tool.cover.SessionManager.getInstance(); + ContentHostingService ch = getService(ContentHostingService.class); + SessionManager sm = getService(SessionManager.class); Session session = sm.getCurrentSession(); session.setUserEid("admin"); session.setUserId("admin");