Package gov.nist.secauto.oscal.lib
Class OscalUtils
- java.lang.Object
-
- gov.nist.secauto.oscal.lib.OscalUtils
-
public final class OscalUtils extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static String
OSCAL_VERSION
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static BackMatter.Resource.Rlink
findMatchingRLink(BackMatter.Resource resource, String preferredMediaType)
static ByteBuffer
getBase64Data(BackMatter.Resource resource)
static URI
getResourceURI(BackMatter.Resource resource, String preferredMediaType)
static boolean
hasBase64Data(BackMatter.Resource resource)
static String
internalReferenceFragmentToId(String fragment)
Get the id based on a URI's fragment.static String
internalReferenceFragmentToId(URI fragment)
Get the id based on a URI's fragment.static boolean
isInternalReference(URI uri)
static InputSource
newInputSource(BackMatter.Resource resource, EntityResolver resolver, String preferredMediaType)
-
-
-
Field Detail
-
OSCAL_VERSION
public static final String OSCAL_VERSION
- See Also:
- Constant Field Values
-
-
Method Detail
-
isInternalReference
public static boolean isInternalReference(@NonNull URI uri)
-
internalReferenceFragmentToId
@NonNull public static String internalReferenceFragmentToId(@NonNull URI fragment)
Get the id based on a URI's fragment.- Parameters:
fragment
- the URI to extract the identifier from- Returns:
- the identifier
- Throws:
IllegalArgumentException
- if the fragment does not contain an identifier
-
internalReferenceFragmentToId
@NonNull public static String internalReferenceFragmentToId(@NonNull String fragment)
Get the id based on a URI's fragment.- Parameters:
fragment
- the URI to extract the identifier from- Returns:
- the identifier
- Throws:
IllegalArgumentException
- if the fragment does not contain an identifier
-
hasBase64Data
public static boolean hasBase64Data(@NonNull BackMatter.Resource resource)
-
getBase64Data
@Nullable public static ByteBuffer getBase64Data(@NonNull BackMatter.Resource resource)
-
getResourceURI
@Nullable public static URI getResourceURI(@NonNull BackMatter.Resource resource, @Nullable String preferredMediaType)
-
findMatchingRLink
@Nullable public static BackMatter.Resource.Rlink findMatchingRLink(@NonNull BackMatter.Resource resource, @Nullable String preferredMediaType)
-
newInputSource
@Nullable public static InputSource newInputSource(@NonNull BackMatter.Resource resource, @NonNull EntityResolver resolver, @Nullable String preferredMediaType) throws IOException
- Throws:
IOException
-
-