Class FSInstallState
- java.lang.Object
-
- org.apache.jackrabbit.vault.packaging.registry.impl.FSInstallState
-
public class FSInstallState extends Object
Internal (immutable) state object for a package to cache and pass the relevant metadata around.
-
-
Constructor Summary
Constructors Constructor Description FSInstallState(@NotNull PackageId pid, @NotNull FSPackageStatus status, @NotNull Path filePath)
-
Method Summary
-
-
-
Constructor Detail
-
FSInstallState
public FSInstallState(@NotNull @NotNull PackageId pid, @NotNull @NotNull FSPackageStatus status, @NotNull @NotNull Path filePath)
-
-
Method Detail
-
withExternal
public FSInstallState withExternal(boolean external)
-
withDependencies
public FSInstallState withDependencies(Set<Dependency> dependencies)
-
withSubPackages
public FSInstallState withSubPackages(Map<PackageId,SubPackageHandling.Option> subPackages)
-
withInstallTime
public FSInstallState withInstallTime(Long installTime)
-
withSize
public FSInstallState withSize(long size)
-
withFilter
public FSInstallState withFilter(WorkspaceFilter filter)
-
withProperties
public FSInstallState withProperties(Properties properties)
-
fromFile
@Nullable public static @Nullable FSInstallState fromFile(Path metaFile) throws IOException
ParsesInstallState
from metafile.- Parameters:
metaFile
- The meta file.- Returns:
- Install state or null if file is not metafile format
- Throws:
IOException
- in case root tag is correct but structure not parsable as expected
-
fromStream
@Nullable public static @Nullable FSInstallState fromStream(InputStream in, String systemId) throws IOException
ParsesInstallState
from metafile.- Parameters:
in
- The input streamsystemId
- the id of the stream- Returns:
- Install state or null if file is not metafile format
- Throws:
IOException
- in case root tag is correct but structure not parsable as expected
-
save
public void save(Path file) throws IOException
Persists the installState to a metadatafile- Parameters:
file
- The files to save the state to- Throws:
IOException
- if an error occurs.
-
save
public void save(OutputStream out) throws IOException
Persists the installState to a metadatafile- Parameters:
out
- Outputsteam to write to.- Throws:
IOException
- if an error occurs.
-
getInstallationTime
public Long getInstallationTime()
-
getSubPackages
public Map<PackageId,SubPackageHandling.Option> getSubPackages()
-
getPackageId
public PackageId getPackageId()
-
getFilePath
public Path getFilePath()
-
isExternal
public boolean isExternal()
-
getStatus
public FSPackageStatus getStatus()
-
getDependencies
public Set<Dependency> getDependencies()
-
getSize
public long getSize()
-
getFilter
public WorkspaceFilter getFilter()
-
getProperties
public Properties getProperties()
-
-