Expand my Community achievements bar.

SOLVED

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

Avatar

Level 3

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.

1 Accepted Solution

Avatar

Correct answer by
Employee

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

View solution in original post

4 Replies

Avatar

Employee

Hi Rob,

would something like this work?

https://support.apple.com/en-ie/HT1629

http://www.christiano.ch/wordpress/2010/11/27/mac-os-x-prevent-ds_store-file-creation-on-network-vol...

I don't have a mac to test this on.

I'm not sure if AEM is able to prevent it, if you'd require an AEM solution, this should be checked with the Support team

Mark

Avatar

Level 3

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.

Avatar

Level 3

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"); } }

Avatar

Correct answer by
Employee

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