Revision 4359
Added by daigle over 15 years ago
DocumentImpl.java | ||
---|---|---|
59 | 59 |
import edu.ucsb.nceas.metacat.util.LDAPUtil; |
60 | 60 |
import edu.ucsb.nceas.metacat.util.MetaCatUtil; |
61 | 61 |
import edu.ucsb.nceas.metacat.util.SystemUtil; |
62 |
import edu.ucsb.nceas.utilities.FileUtil; |
|
62 | 63 |
import edu.ucsb.nceas.utilities.PropertyNotFoundException; |
63 | 64 |
|
64 | 65 |
import org.apache.log4j.Logger; |
... | ... | |
1319 | 1320 |
String xmlFileLine; |
1320 | 1321 |
String xmlFileContents = ""; |
1321 | 1322 |
|
1322 |
try { |
|
1323 |
// read the file from disk |
|
1324 |
FileReader fileReader = new FileReader(documentPath); |
|
1325 |
BufferedReader br = new BufferedReader(fileReader); |
|
1326 |
while ((xmlFileLine = br.readLine()) != null) { |
|
1327 |
xmlFileContents += xmlFileLine; |
|
1328 |
} |
|
1323 |
try { |
|
1324 |
xmlFileContents = FileUtil.readFileToString(documentPath); |
|
1329 | 1325 |
|
1330 | 1326 |
// get a list of inline data sections that are not readable |
1331 | 1327 |
// by this user |
... | ... | |
1369 | 1365 |
*/ |
1370 | 1366 |
private String stripInlineData(String xmlFileContents, String inLineKey) { |
1371 | 1367 |
String changedString = xmlFileContents; |
1372 |
String regex = "(<distribution .*id=\"" + inLineKey + "\">.*)<inline>.*</inline>(.*<\\distribution>)";
|
|
1368 |
String regex = "(<distribution .*id=\"" + inLineKey + "\">.*)<inline>.*</inline>(.*</distribution>)";
|
|
1373 | 1369 |
Pattern pattern = Pattern.compile(regex, Pattern.CASE_INSENSITIVE); |
1374 | 1370 |
Matcher matcher = pattern.matcher(xmlFileContents); |
1375 | 1371 |
if (matcher.find()) { |
Also available in: Unified diff
Fix workgroup description