Package org.spdx.rdfparser
Class SPDXFile
java.lang.Object
org.spdx.rdfparser.SPDXFile
- All Implemented Interfaces:
Cloneable,Comparable<SPDXFile>
@Deprecated public class SPDXFile extends Object implements Comparable<SPDXFile>, Cloneable
Deprecated.
Contains and SPDXFile object and updates the RDF model.
This class is for compatibility with the 1.2 version of the SPDX library
and is no longer used for version 2.0 and above.
- Author:
- Gary O'Neall
-
Field Summary
Fields Modifier and Type Field Description static Map<String,String>FILE_TYPE_TO_RESOURCEDeprecated.static Map<String,String>RESOURCE_TO_FILE_TYPEDeprecated. -
Constructor Summary
Constructors Constructor Description SPDXFile(String name, String type, String sha1, AnyLicenseInfo concludedLicenses, AnyLicenseInfo[] seenLicenses, String licenseComments, String copyright, DOAPProject[] artifactOf)Deprecated.SPDXFile(String name, String type, String sha1, AnyLicenseInfo concludedLicenses, AnyLicenseInfo[] seenLicenses, String licenseComments, String copyright, DOAPProject[] artifactOf, String comment)Deprecated.SPDXFile(String name, String type, String sha1, AnyLicenseInfo concludedLicenses, AnyLicenseInfo[] seenLicenses, String licenseComments, String copyright, DOAPProject[] artifactOf, String comment, SPDXFile[] fileDependencies, String[] contributors, String noticeText)Deprecated.SPDXFile(IModelContainer modelContainer, org.apache.jena.graph.Node fileNode)Deprecated.Construct an SPDX File form the fileNode -
Method Summary
Modifier and Type Method Description SPDXFileclone()Deprecated.SPDXFileclone(SPDXDocument doc, String fileUri)Deprecated.Create a deep copy or clone of this file including all properties.intcompareTo(SPDXFile file)Deprecated.This method is used for sorting a list of SPDX filesorg.apache.jena.rdf.model.ResourcecreateResource(SPDXDocument doc, String uri)Deprecated.Create a resource for this SPDX filebooleanequals(Object o)Deprecated.booleanequivalent(SPDXFile compareToFile)Deprecated.Returns true if all of the properties of the compareToFile are equivalent or equal to all properties of this SPDXFile.static StringfileTypeResourceToString(org.apache.jena.rdf.model.Resource fileTypeResource)Deprecated.static org.apache.jena.rdf.model.ResourcefileTypeStringToTypeResource(String fileType, org.apache.jena.rdf.model.Model model)Deprecated.Converts a string file type to an RDF resourceprotected static org.apache.jena.rdf.model.ResourcefindFileResource(org.apache.jena.rdf.model.Model model, SPDXFile spdxFile)Deprecated.Finds the resource for an existing file in the modelDOAPProject[]getArtifactOf()Deprecated.StringgetComment()Deprecated.AnyLicenseInfogetConcludedLicenses()Deprecated.String[]getContributors()Deprecated.StringgetCopyright()Deprecated.SPDXFile[]getFileDependencies()Deprecated.StringgetLicenseComments()Deprecated.StringgetName()Deprecated.StringgetNoticeText()Deprecated.protected org.apache.jena.rdf.model.ResourcegetResource()Deprecated.AnyLicenseInfo[]getSeenLicenses()Deprecated.StringgetSha1()Deprecated.StringgetType()Deprecated.inthashCode()Deprecated.voidsetArtifactOf(DOAPProject[] artifactOf)Deprecated.voidsetComment(String comment)Deprecated.voidsetConcludedLicenses(AnyLicenseInfo fileLicenses)Deprecated.voidsetContributors(String[] contributors)Deprecated.Set the contributors to the filevoidsetCopyright(String copyright)Deprecated.voidsetFileDependencies(SPDXFile[] fileDependencies, SPDXDocument doc)Deprecated.Set the file dependencies for this filevoidsetLicenseComments(String licenseComments)Deprecated.voidsetName(String name)Deprecated.voidsetNoticeText(String noticeText)Deprecated.voidsetSeenLicenses(AnyLicenseInfo[] seenLicenses)Deprecated.voidsetSha1(String sha1)Deprecated.voidsetType(String type)Deprecated.List<String>verify()Deprecated.
-
Field Details
-
FILE_TYPE_TO_RESOURCE
Deprecated. -
RESOURCE_TO_FILE_TYPE
Deprecated.
-
-
Constructor Details
-
SPDXFile
public SPDXFile(IModelContainer modelContainer, org.apache.jena.graph.Node fileNode) throws InvalidSPDXAnalysisExceptionDeprecated.Construct an SPDX File form the fileNode- Parameters:
fileNode- RDF Graph node representing the SPDX File- Throws:
InvalidSPDXAnalysisException
-
SPDXFile
public SPDXFile(String name, String type, String sha1, AnyLicenseInfo concludedLicenses, AnyLicenseInfo[] seenLicenses, String licenseComments, String copyright, DOAPProject[] artifactOf, String comment, SPDXFile[] fileDependencies, String[] contributors, String noticeText)Deprecated. -
SPDXFile
public SPDXFile(String name, String type, String sha1, AnyLicenseInfo concludedLicenses, AnyLicenseInfo[] seenLicenses, String licenseComments, String copyright, DOAPProject[] artifactOf)Deprecated. -
SPDXFile
public SPDXFile(String name, String type, String sha1, AnyLicenseInfo concludedLicenses, AnyLicenseInfo[] seenLicenses, String licenseComments, String copyright, DOAPProject[] artifactOf, String comment)Deprecated.
-
-
Method Details
-
createResource
public org.apache.jena.rdf.model.Resource createResource(SPDXDocument doc, String uri) throws InvalidSPDXAnalysisExceptionDeprecated.Create a resource for this SPDX file- Parameters:
uri- URI for the file resourcedoc- SPDX document containing the SPDX file- Returns:
- Throws:
InvalidSPDXAnalysisException
-
findFileResource
protected static org.apache.jena.rdf.model.Resource findFileResource(org.apache.jena.rdf.model.Model model, SPDXFile spdxFile) throws InvalidSPDXAnalysisExceptionDeprecated.Finds the resource for an existing file in the model- Parameters:
spdxFile-- Returns:
- resource of an SPDX file with the same name and checksum. Null if none found
- Throws:
InvalidSPDXAnalysisException
-
getSeenLicenses
Deprecated.- Returns:
- the seenLicenses
- Throws:
InvalidSPDXAnalysisException
-
setSeenLicenses
Deprecated.- Parameters:
seenLicenses- the seenLicenses to set- Throws:
InvalidSPDXAnalysisException
-
getLicenseComments
Deprecated.- Returns:
- the licenseComments
-
setLicenseComments
Deprecated.- Parameters:
licenseComments- the licenseComments to set
-
getNoticeText
Deprecated.- Returns:
- the noticeText
-
setNoticeText
Deprecated.- Parameters:
noticeTexgt- the noticeText to set
-
getComment
Deprecated. -
setComment
Deprecated. -
getCopyright
Deprecated.- Returns:
- the copyright
-
setCopyright
Deprecated.- Parameters:
copyright- the copyright to set
-
getName
Deprecated.- Returns:
- the name
-
setName
Deprecated.- Parameters:
name- the name to set
-
getConcludedLicenses
Deprecated.- Returns:
- the fileLicenses
- Throws:
InvalidSPDXAnalysisException
-
setConcludedLicenses
Deprecated.- Parameters:
fileLicenses- the fileLicenses to set- Throws:
InvalidSPDXAnalysisException
-
getSha1
Deprecated.- Returns:
- the sha1
- Throws:
InvalidSPDXAnalysisException
-
setSha1
Deprecated.- Parameters:
sha1- the sha1 to set
-
getType
Deprecated.- Returns:
- the type
- Throws:
InvalidSPDXAnalysisException
-
setType
Deprecated.- Parameters:
type- the type to set- Throws:
InvalidSPDXAnalysisException
-
fileTypeStringToTypeResource
public static org.apache.jena.rdf.model.Resource fileTypeStringToTypeResource(String fileType, org.apache.jena.rdf.model.Model model) throws InvalidSPDXAnalysisExceptionDeprecated.Converts a string file type to an RDF resource- Parameters:
fileType-- Returns:
- Throws:
InvalidSPDXAnalysisException
-
fileTypeResourceToString
public static String fileTypeResourceToString(org.apache.jena.rdf.model.Resource fileTypeResource) throws InvalidSPDXAnalysisExceptionDeprecated.- Throws:
InvalidSPDXAnalysisException
-
getArtifactOf
Deprecated.- Returns:
- the artifactOf
- Throws:
InvalidSPDXAnalysisException
-
setArtifactOf
Deprecated.- Parameters:
artifactOf- the artifactOf to set
-
verify
Deprecated.- Returns:
-
getFileDependencies
Deprecated.- Returns:
- file dependencies
- Throws:
InvalidSPDXAnalysisException
-
setFileDependencies
public void setFileDependencies(SPDXFile[] fileDependencies, SPDXDocument doc) throws InvalidSPDXAnalysisExceptionDeprecated.Set the file dependencies for this file- Parameters:
fileDependencies-doc- SPDX Document containing the file dependencies- Throws:
InvalidSPDXAnalysisException
-
equals
Deprecated. -
hashCode
public int hashCode()Deprecated. -
getResource
protected org.apache.jena.rdf.model.Resource getResource()Deprecated.- Returns:
- the Jena resource if it exists in the model
-
getContributors
Deprecated.- Returns:
- contributors to the file
-
setContributors
Deprecated.Set the contributors to the file- Parameters:
contributors-
-
compareTo
Deprecated.This method is used for sorting a list of SPDX files- Specified by:
compareToin interfaceComparable<SPDXFile>- Parameters:
file- SPDXFile that is compared- Returns:
-
clone
Deprecated.Create a deep copy or clone of this file including all properties. The cloned SPDX file is created within the SPDX document using the provided fileUri and the SPDXDocument model is populated with all of the properties.- Parameters:
doc- Document containing the Model used to create the copy of this SPDX filefileUri-- Returns:
- Throws:
InvalidSPDXAnalysisException
-
clone
Deprecated. -
equivalent
Deprecated.Returns true if all of the properties of the compareToFile are equivalent or equal to all properties of this SPDXFile. Equivalent is different from equals in that the equals method will only return true if it is the same object.- Parameters:
compareToFile-- Returns:
-