Revision 45629
Added by Sandro La Bruzzo over 7 years ago
modules/dnet-fs-objectstore/trunk/src/main/java/eu/dnetlib/data/objectstore/filesystem/ObjectStoreFileUtility.java | ||
---|---|---|
1 | 1 |
package eu.dnetlib.data.objectstore.filesystem; |
2 | 2 |
|
3 |
import java.io.UnsupportedEncodingException; |
|
4 |
|
|
5 | 3 |
import com.mongodb.DBObject; |
6 | 4 |
import eu.dnetlib.data.objectstore.rmi.ObjectStoreFile; |
7 | 5 |
import eu.dnetlib.data.objectstore.rmi.Protocols; |
8 | 6 |
import eu.dnetlib.miscutils.functional.UnaryFunction; |
7 |
import org.apache.commons.lang.StringUtils; |
|
9 | 8 |
import org.apache.commons.logging.Log; |
10 | 9 |
import org.apache.commons.logging.LogFactory; |
11 | 10 |
|
11 |
import java.io.UnsupportedEncodingException; |
|
12 |
|
|
12 | 13 |
/** |
13 | 14 |
* The Class ObjectStoreFileBuilder generates an objectStoreFile bean |
14 | 15 |
* |
... | ... | |
36 | 37 |
} |
37 | 38 |
if (originalFile != null) { |
38 | 39 |
newFile.setMetadataRelatedID(original.getMetadataRelatedID()); |
39 |
if ((original.getDownloadedURL() == null) || (original.getDownloadedURL().length() == 0)) {
|
|
40 |
newFile.setDownloadedURL(original.getURI());
|
|
41 |
} else {
|
|
40 |
if (StringUtils.isBlank(original.getDownloadedURL())) {
|
|
41 |
newFile.setDownloadedURL((String) metadata.get("uri"));
|
|
42 |
} else {
|
|
42 | 43 |
newFile.setDownloadedURL(original.getDownloadedURL()); |
43 | 44 |
} |
44 | 45 |
} |
Also available in: Unified diff
fixed bug on webcrawl downloaded item