use of org.eclipse.tycho.p2.repository.GAV in project tycho by eclipse.
the class FileBasedTychoRepositoryIndex method read.
private Set<GAV> read(InputStream inStream) throws IOException {
LinkedHashSet<GAV> result = new LinkedHashSet<>();
BufferedReader reader = new BufferedReader(new InputStreamReader(inStream, ENCODING));
try {
String line;
while ((line = reader.readLine()) != null) {
if (line.trim().length() == 0) {
continue;
}
try {
GAV parsedGAV = GAV.parse(line);
result.add(parsedGAV);
} catch (IllegalArgumentException e) {
logger.warn("Ignoring invalid line '" + line + "' in " + indexFile);
}
}
} finally {
reader.close();
}
return result;
}
use of org.eclipse.tycho.p2.repository.GAV in project tycho by eclipse.
the class ModuleArtifactRepository method load.
private void load() throws ProvisionException {
try {
FileInputStream p2DataFileStream = new FileInputStream(p2DataFile);
try {
Set<IArtifactDescriptor> descriptors = new ArtifactsIO().readXML(p2DataFileStream);
for (IArtifactDescriptor descriptor : descriptors) {
ModuleArtifactDescriptor internalDescriptor = getInternalDescriptorFromLoadedDescriptor(descriptor, p2DataFile);
// TODO check that GAV properties match module GAV
internalAddInternalDescriptor(internalDescriptor);
}
} finally {
p2DataFileStream.close();
}
} catch (IOException e) {
throw failedReadException(p2DataFile, null, e);
}
}
Aggregations