.DS_Store files created in Repository when connecting via WebDAV from a MAC

Rob_Curran__T4G

19-10-2016

These files get created at each level in the repository when a user creates content (uploads files) via WebDAV to the DAM.  There are actually two files I think... .DS_Store and _.DS_Store...

Is there a way to avoid this / correct it?

Thanks,

 

Rob.

Accepted Solutions (1)

Accepted Solutions (1)

mvance

Employee

08-11-2016

Hi Rob,

Yes this seems feasible, but AEM should not create these files. In fact this ignore ability was added in a very old version (5.3) so if it is occurring for you on a newer version, this can be reported to the Customer Care team to investigate and log the issue.

Thanks,

Mark

Answers (3)

Answers (3)

Rob_Curran__T4G

27-10-2016

I did also find this thread:  http://stackoverflow.com/questions/33129042/how-to-hide-hidden-files-in-aem-crxde-lite

Which suggests using an OSGi scheduler to simply delete them regularly from AEM.

package com.foo.bar; import org.apache.felix.scr.annotations.sling.SlingServlet; import org.apache.sling.api.SlingHttpServletRequest; import org.apache.sling.api.SlingHttpServletResponse; import org.apache.sling.api.resource.Resource; import org.apache.sling.api.resource.ResourceResolver; import org.apache.sling.api.servlets.SlingSafeMethodsServlet; import javax.jcr.query.Query; import javax.servlet.ServletException; import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.io.PrintWriter; import java.util.Iterator; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @SlingServlet(paths={"/bin/deletedsstore"}) public class DeleteDSStoreServlet extends SlingSafeMethodsServlet { private static final long serialVersionUID = 1L; private static final Logger log = LoggerFactory.getLogger(DeleteDSStoreServlet.class); private static final String SQL2_QUERY = "SELECT * FROM [nt:base] AS s WHERE ISDESCENDANTNODE([/content]) and NAME() = '.DS_Store'"; private static final int SAVE_THRESHOLD = 100; @Override protected void doGet(SlingHttpServletRequest request, SlingHttpServletResponse response) throws ServletException, IOException { ResourceResolver resolver = request.getResourceResolver(); Iterator<Resource> resources = resolver.findResources(SQL2_QUERY, Query.JCR_SQL2); int deleted = 0; while (resources.hasNext()) { Resource resource = resources.next(); String path = resource.getPath(); resolver.delete(resource); log.info("Deleted node: " + path); deleted++; if (deleted % SAVE_THRESHOLD == 0) { resolver.commit(); } } if (resolver.hasChanges()) { resolver.commit(); } response.setStatus(HttpServletResponse.SC_OK); PrintWriter out = response.getWriter(); out.write("Deleted " + deleted + " .DS_Store nodes"); } }

Rob_Curran__T4G

27-10-2016

Thanks Mark.

This looks promising if the users are willing to make this configuration change.  

I don't have a MAC to test on either...  

Your response is appreciated.