Skip to content

Instantly share code, notes, and snippets.

View greggigon's full-sized avatar
🎧
Focusing

Greg greggigon

🎧
Focusing
View GitHub Profile
@greggigon
greggigon / RepositorySize.groovy
Created June 19, 2013 09:41
This simple Artifactory plugin does a job of Calculating repository size by recursively iterating over Repository items and adding sizes of the artifacts.
import org.artifactory.repo.RepoPathFactory
def getDirectorySizeRecursively(def repoPath){
def children = repositories.getChildren(repoPath)
if (children.size() == 0) return 0
def total = 0
children.each { item ->
if (item.folder) {
total += getDirectorySizeRecursively(item.repoPath)