Child: [r23] (diff)

Download this file

lib.java    164 lines (146 with data), 5.1 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
package unknown;
import java.io.File;
import java.util.Date;
import script.FileExtension;
import spdxlib.ContentType;
import spdxlib.FileCategory;
/*
* SPDXVersion: SPDX-1.1
* Creator: Person: Nuno Brito
* Created: 2013-11-17T00:00:08Z
* LicenseName: CC-BY-3.0
* TemplateVersion: TC-2013-11-16
* FileName: lib.java
* FileCategory: SOURCE
* FileCopyrightText: <text> Copyright Š 2013, Nuno Brito </text>
* FileComment: <text> This class provides details about the files that make
* use of the "lib" extension. When possible, the file provenance author
* includes details such as date when this extension first began to be used.
* There are cases where different data structures use the same file extension,
* when this happens then the author needs to accomodate code to accurately
* detect which type of file is being analysed.
* </text>
*/
/**
*
* @file provenance by Nuno Brito
*/
public class lib extends FileExtension{
/**
* How can we confirm that this file extension is appliable to this file?
* This method analyses the binary contents of a file to get the answer.
* @param binaryFile the pointer to a file on disk
* @return True if file matches the data structure reported by the extension
*/
@Override
public Boolean isApplicable(File binaryFile) {
return true;
}
/**
* How can we confirm that this file extension is appliable to this file?
* This method analyses the text of a file to get the answer. You can either
* specify a file or the text. The advantage of using this method is that
* you will not need to read the text from the file for each extension test.
* This brings significant performance improvements when analyzing
* thousands of files.
* @param textFile The content of a text file
* @return True if file matches the data structure reported by the extension
*/
@Override
public Boolean isApplicable(String textFile) {
return true;
}
/**
* A short text explaining what this file type is all about
*/
@Override
public String getDescription() {
return null; // file type description
}
/**
* Are we collecting this description information from somewhere else?
*/
@Override
public String getDescriptionURL(){
return null; // where the original page can be reached
}
/**
* Who is the owner for description that was provided?
* What are the applicable license terms?
*/
@Override
public String getDescriptionCredits(){
return null; //author of description
}
/**
* Typically, this is the three letter identifier of the file extension.
* We use everything in lower case to speed the processing performance.
* @return the unique identifier for this file type
*/
@Override
public String getIdentifierShort() {
return "lib";
}
/**
* Who has the copyright over this extension? This is information that
* might be extracted from the meta-data inside the data contents. When
* available, this information is available using this method.
* @return A string with with copyright text extracted from the file
*/
@Override
public String getCopyright() {
return null;
}
/**
* What is the version for this file? Sometimes this is information that
* can be extracted from the meta-data inside the data contents. When
* available, this information is available using this method.
* @return A string with with version text extracted from the file
*/
@Override
public String getVersion() {
return null;
}
/**
* How old is the oldest file that we have found of this kind?
*/
@Override
public Date earliestKnownRecord(){
// syntax example that you can use for recording the date
// Date result = utils.time.getDate(1999, 01, 01);
return null;
}
/**
* What are the MIME types registered for this file?
*/
@Override
public String getMIME(){
return null;
}
/**
* Returns information is this file has a binary or text based structure.
* This is later used by the "isApplicable()" methods to speed up the
* processing of each file
* @return the type of content expected inside the file
*/
@Override
public ContentType getContentType() {
return ContentType.UNKNOWN; // is it a binary or text file?
}
/**
* We can typically group data structures inside files to a few categories.
* Albeit not perfect, it does help to sort out files into groups.
* @return the category generally associated with this file type
*/
@Override
public FileCategory getCategory() {
return FileCategory.UNKNOWN; // does it group under a category?
}
/**
* The normal designation for these kind of files.
*/
@Override
public String getIdentifierLong(){
return null; // how is this file
}
}