Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
JAliEn
JAliEn
Commits
b6e722de
Commit
b6e722de
authored
Aug 03, 2018
by
Volodymyr Yurchenko
Browse files
More options in XmlCollection ctors
parent
785aaf53
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/alien/catalogue/XmlCollection.java
View file @
b6e722de
...
...
@@ -59,6 +59,18 @@ public class XmlCollection extends LinkedHashSet<LFN> {
parseXML
(
content
);
}
/**
* Parse this XML
*
* @param content
* @param getReal
* must be true if you want real LFN objects from a database
* @throws IOException
*/
public
XmlCollection
(
final
String
content
,
final
boolean
getReal
)
throws
IOException
{
parseXML
(
content
,
getReal
);
}
/**
* read the contents of a LFN in the catalogue
*
...
...
@@ -72,6 +84,21 @@ public class XmlCollection extends LinkedHashSet<LFN> {
parseXML
(
IOUtils
.
getContents
(
lfn
));
}
/**
* read the contents of a LFN in the catalogue
*
* @param lfn
* @param getReal
* must be true if you want real LFN objects from a database
* @throws IOException
*/
public
XmlCollection
(
final
LFN
lfn
,
final
boolean
getReal
)
throws
IOException
{
if
(
lfn
==
null
||
!
lfn
.
isFile
())
throw
new
IOException
(
"LFN is not readable"
);
parseXML
(
IOUtils
.
getContents
(
lfn
),
getReal
);
}
/**
* read the contents of a GUID in the catalogue
*
...
...
@@ -90,6 +117,11 @@ public class XmlCollection extends LinkedHashSet<LFN> {
}
private
void
parseXML
(
final
String
content
,
final
boolean
getReal
)
throws
IOException
{
if
(
content
==
null
)
{
System
.
err
.
println
(
"Failed to read a content of XML collection: "
+
this
.
getName
());
return
;
}
final
BufferedReader
br
=
new
BufferedReader
(
new
StringReader
(
content
));
String
sLine
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment