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 StringOSCAL_VERSION
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static BackMatter.Resource.RlinkfindMatchingRLink(BackMatter.Resource resource, String preferredMediaType)static ByteBuffergetBase64Data(BackMatter.Resource resource)static URIgetResourceURI(BackMatter.Resource resource, String preferredMediaType)static booleanhasBase64Data(BackMatter.Resource resource)static StringinternalReferenceFragmentToId(String fragment)Get the id based on a URI's fragment.static StringinternalReferenceFragmentToId(URI fragment)Get the id based on a URI's fragment.static booleanisInternalReference(URI uri)static InputSourcenewInputSource(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
-
-