Package ai.platon.pulsar.common.browser
Object BrowserFiles
-
- All Implemented Interfaces:
public class BrowserFiles
-
-
Field Summary
Fields Modifier and Type Field Description public final static StringCONTEXT_DIR_PREFIXpublic final static StringPID_FILE_NAMEprivate final DurationTEMPORARY_UDD_EXPIRYpublic final static BrowserFilesINSTANCE
-
Method Summary
Modifier and Type Method Description final PathcomputeTestContextDir(Fingerprint fingerprint, Integer maxAgents)Compute the next sequential test context directory. final PathcomputeNextSequentialContextDir(String group, Fingerprint fingerprint, Integer maxAgents)Compute the next sequential context directory. final PathcomputeRandomTmpContextDir(String group)final UnitcleanOldestContextTmpDirs(Integer recentNToKeep)final UnitcleanUpContextTmpDir(Duration expiry)final UnitcleanUpContextDir(Path path, Duration expiry)Clear the browser's user data dir inside the given context path. final UnitdeleteTemporaryUserDataDirWithLock(Path userDataDir, Duration expiry)final DurationgetTEMPORARY_UDD_EXPIRY()-
-
Method Detail
-
computeTestContextDir
@Synchronized() final Path computeTestContextDir(Fingerprint fingerprint, Integer maxAgents)
Compute the next sequential test context directory. A typical context directory is like: /tmp/pulsar-vincent/context/group/test/cx.1
- Parameters:
fingerprint- The fingerprintmaxAgents- The maximum number of available agents, every agent has its own context directory- Returns:
The next sequential context directory
-
computeNextSequentialContextDir
@Synchronized() final Path computeNextSequentialContextDir(String group, Fingerprint fingerprint, Integer maxAgents)
Compute the next sequential context directory. A typical context directory is like: /tmp/pulsar-vincent/context/group/default/cx.1
- Parameters:
group- The group name, default is "default"fingerprint- The fingerprintmaxAgents- The maximum number of available agents, every agent has its own context directory- Returns:
The next sequential context directory
-
computeRandomTmpContextDir
@Synchronized() final Path computeRandomTmpContextDir(String group)
-
cleanOldestContextTmpDirs
final Unit cleanOldestContextTmpDirs(Integer recentNToKeep)
-
cleanUpContextTmpDir
final Unit cleanUpContextTmpDir(Duration expiry)
-
cleanUpContextDir
final Unit cleanUpContextDir(Path path, Duration expiry)
Clear the browser's user data dir inside the given context path.
- Parameters:
path- The context pathexpiry- The expiry duration
-
deleteTemporaryUserDataDirWithLock
@Synchronized() final Unit deleteTemporaryUserDataDirWithLock(Path userDataDir, Duration expiry)
-
getTEMPORARY_UDD_EXPIRY
final Duration getTEMPORARY_UDD_EXPIRY()
-
-
-
-