Search in sources :

Example 6 with FileRef

use of org.openlca.ilcd.sources.FileRef in project olca-modules by GreenDelta.

the class SourcesFileNameTest method testWindowsPath.

@Test
public void testWindowsPath() {
    FileRef ref = new FileRef();
    ref.uri = "C:/external_docs/mydoc.pdf";
    assertEquals("mydoc.pdf", Sources.getFileName(ref));
    ref.uri = "C:\\external_docs\\mydoc.pdf";
    assertEquals("mydoc.pdf", Sources.getFileName(ref));
}
Also used : FileRef(org.openlca.ilcd.sources.FileRef) Test(org.junit.Test)

Example 7 with FileRef

use of org.openlca.ilcd.sources.FileRef in project olca-modules by GreenDelta.

the class SourcesFileNameTest method testUnescapePath.

@Test
public void testUnescapePath() {
    FileRef ref = new FileRef();
    ref.uri = "http://mysoda.com/external_docs/my%20doc.pdf";
    assertEquals("my doc.pdf", Sources.getFileName(ref));
}
Also used : FileRef(org.openlca.ilcd.sources.FileRef) Test(org.junit.Test)

Aggregations

FileRef (org.openlca.ilcd.sources.FileRef)7 Test (org.junit.Test)4 ArrayList (java.util.ArrayList)1 LangString (org.openlca.ilcd.commons.LangString)1 DataSetInfo (org.openlca.ilcd.sources.DataSetInfo)1