Revision 33900
Added by Sandro La Bruzzo over 9 years ago
modules/dnet-download-plugins/trunk/src/main/java/eu/dnetlib/download/plugin/ArxivImportFromFile.java | ||
---|---|---|
6 | 6 |
import java.util.List; |
7 | 7 |
|
8 | 8 |
import org.apache.commons.lang.StringUtils; |
9 |
import org.apache.commons.logging.Log; |
|
10 |
import org.apache.commons.logging.LogFactory; |
|
9 | 11 |
|
10 | 12 |
import com.google.common.base.Function; |
11 | 13 |
import com.google.common.collect.Iterables; |
... | ... | |
16 | 18 |
|
17 | 19 |
public class ArxivImportFromFile extends AbstractDownloadPlugin implements DownloadPlugin { |
18 | 20 |
|
21 |
private static final Log log = LogFactory.getLog(ArxivImportFromFile.class); // NOPMD by marko on 11/24/08 5:02 PM |
|
22 |
|
|
19 | 23 |
/** The base path. */ |
20 | 24 |
private String basePath; |
21 | 25 |
|
... | ... | |
32 | 36 |
item.setUrl(null); |
33 | 37 |
return item; |
34 | 38 |
} |
35 |
// String[] values = name.split("\\."); |
|
36 |
// Path bsPath = Paths.get(basePath); |
|
37 |
// Path filePath = Paths.get(String.format("%s/%s.pdf", values[0], name)); |
|
38 | 39 |
|
39 |
// String fileURL = bsPath.resolve(filePath).toString(); |
|
40 | 40 |
String fileURL = createPath(name); |
41 | 41 |
File f = new File(fileURL); |
42 | 42 |
if (f.exists()) { |
43 |
log.debug("found path associated to " + item.getIdItemMetadata() + " with path : " + fileURL); |
|
43 | 44 |
item.setUrl("file://" + fileURL); |
44 | 45 |
} else { |
46 |
log.debug("NOT found path associated to " + item.getIdItemMetadata()); |
|
45 | 47 |
item.setUrl(null); |
46 | 48 |
} |
47 | 49 |
item.setOriginalUrl(baseURL); |
Also available in: Unified diff
added further logs