title: Finding/deleting single artifacts in Artifactory -- not files
body: <p>I have a question about usage of the Artifactory REST API. Some guidance would be useful.</p>
  
  <p>I'm building a script that exercises Artifactory's REST API. The goal of this script is to find artifacts that are old, meet some other requirements, and then delete them. (Doesn't every Artifactory owner end up building one of those?)</p>
  
  <p>There is a documented <a href="https://www.jfrog.com/confluence/display/RTF/Artifactory+REST+API#ArtifactoryRESTAPI-ArtifactsNotDownloadedSince" rel="nofollow noreferrer">"Artifacts Not Downloaded Since"</a>, which returns a list of files. For "artifacts" I would rather have expected some concept that contains multiple files (like for Maven: a POM and a few JARs). The fact that it returns just single files has me now strip the file name, then delete the whole folder.</p>
  
  <ol>
  <li>Query returns: <a href="https://.../repository/api/storage/libs-snapshot-local/com/x/y/1.0.0-SNAPSHOT/y-1.0.0-SNAPSHOT.jar" rel="nofollow noreferrer">https://.../repository/api/storage/libs-snapshot-local/com/x/y/1.0.0-SNAPSHOT/y-1.0.0-SNAPSHOT.jar</a></li>
  <li>I strip: <a href="https://.../repository/api/storage/libs-snapshot-local/com/x/y/1.0.0-SNAPSHOT/" rel="nofollow noreferrer">https://.../repository/api/storage/libs-snapshot-local/com/x/y/1.0.0-SNAPSHOT/</a></li>
  <li>I delete that stripped folder.</li>
  </ol>
  
  <p>I am scared that the folder in question contains other files (a POM file or some other file in that folder) that was downloaded more recently, yet still gets deleted now.</p>
  
  <p>Why is this stuff not reported by the REST API on the artifact level (GAV level)?</p>
  
  <p>For Docker repositories a related question, does "Not Downloaded Since" at all consider child containers? Or is there an approach that I should use to just delete the tag, and Artifactory will auto-remove the associated, but unused, image/layer files?</p>