Package hudson.plugins.disk_usage
Class DiskUsageUtil
- java.lang.Object
-
- hudson.plugins.disk_usage.DiskUsageUtil
-
public class DiskUsageUtil extends Object
- Author:
- Lucie Votypkova
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DiskUsageUtil.DiskUsageCallable
ACallable
which computes disk usage of remote file object
-
Constructor Summary
Constructors Constructor Description DiskUsageUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
addProperty(Item item)
static void
calculateDiskUsageForBuild(String buildId, AbstractProject project)
static void
calculateDiskUsageForProject(AbstractProject project)
static void
calculateWorkspaceDiskUsage(AbstractProject project)
static Long
calculateWorkspaceDiskUsageForPath(FilePath workspace, ArrayList<FilePath> exceeded)
static void
calculationDiskUsageOfBuild(AbstractBuild build, TaskListener listener)
Calculate disk usage of build after its execution (or as post-build step)static void
controlAllJobsExceedSize()
static void
controlWorkspaceExceedSize(AbstractProject project)
static String
formatTimeInMilisec(long time)
static List<AbstractProject>
getAllProjects(ItemGroup<? extends Item> itemGroup)
static Date
getDate(int unit, int count)
static Date
getDate(String timeCount, String timeUnit)
static Long
getFileSize(File f, List<File> exceedFiles)
static int
getIndex(String unit)
static double
getScale(long number)
static Long
getSizeInBytes(String stringSize)
static String
getSizeString(Long size)
static String
getUnitString(int floor)
static boolean
isSymlink(File f)
protected static void
loadData(DiskUsageProperty property, boolean loadAllBuilds)
static List<String>
parseExcludedJobsFromString(String jobs)
static void
sendEmail(String subject, String message)
-
-
-
Field Detail
-
LOGGER
public static final Logger LOGGER
-
-
Method Detail
-
addProperty
public static void addProperty(Item item)
-
loadData
protected static void loadData(DiskUsageProperty property, boolean loadAllBuilds)
-
getDate
public static Date getDate(int unit, int count)
-
formatTimeInMilisec
public static String formatTimeInMilisec(long time)
-
sendEmail
public static void sendEmail(String subject, String message) throws jakarta.mail.MessagingException
- Throws:
jakarta.mail.MessagingException
-
controlAllJobsExceedSize
public static void controlAllJobsExceedSize() throws IOException
- Throws:
IOException
-
controlWorkspaceExceedSize
public static void controlWorkspaceExceedSize(AbstractProject project)
-
getScale
public static double getScale(long number)
-
getIndex
public static int getIndex(String unit)
-
getUnitString
public static String getUnitString(int floor)
-
calculationDiskUsageOfBuild
public static void calculationDiskUsageOfBuild(AbstractBuild build, TaskListener listener)
Calculate disk usage of build after its execution (or as post-build step)- Parameters:
build
-listener
-
-
isSymlink
public static boolean isSymlink(File f) throws IOException
- Throws:
IOException
-
getFileSize
public static Long getFileSize(File f, List<File> exceedFiles) throws IOException
- Throws:
IOException
-
calculateDiskUsageForProject
public static void calculateDiskUsageForProject(AbstractProject project) throws IOException
- Throws:
IOException
-
calculateDiskUsageForBuild
public static void calculateDiskUsageForBuild(String buildId, AbstractProject project) throws IOException
- Throws:
IOException
-
calculateWorkspaceDiskUsageForPath
public static Long calculateWorkspaceDiskUsageForPath(FilePath workspace, ArrayList<FilePath> exceeded) throws IOException, InterruptedException
- Throws:
IOException
InterruptedException
-
calculateWorkspaceDiskUsage
public static void calculateWorkspaceDiskUsage(AbstractProject project) throws IOException, InterruptedException
- Throws:
IOException
InterruptedException
-
getAllProjects
public static List<AbstractProject> getAllProjects(ItemGroup<? extends Item> itemGroup)
-
-