Search in sources :

Example 31 with Source

use of org.openlca.core.model.Source in project olca-app by GreenDelta.

the class SourceInfoPage method copyAndSetFile.

private void copyAndSetFile(File file, File dbFile) {
    try {
        log.trace("copy file {} to database folder", file);
        File dir = dbFile.getParentFile();
        if (!dir.exists())
            dir.mkdirs();
        Files.copy(file, dbFile);
        Source source = getModel();
        source.externalFile = dbFile.getName();
        getEditor().setDirty(true);
        updateFileLink();
    } catch (Exception e) {
        log.error("failed to copy file", e);
    }
}
Also used : File(java.io.File) Source(org.openlca.core.model.Source)

Aggregations

Source (org.openlca.core.model.Source)31 Process (org.openlca.core.model.Process)5 ProcessDocumentation (org.openlca.core.model.ProcessDocumentation)5 SourceDao (org.openlca.core.database.SourceDao)4 Actor (org.openlca.core.model.Actor)4 ISource (org.openlca.ecospold.ISource)4 DQSystem (org.openlca.core.model.DQSystem)3 Flow (org.openlca.core.model.Flow)3 FlowProperty (org.openlca.core.model.FlowProperty)3 UnitGroup (org.openlca.core.model.UnitGroup)3 File (java.io.File)2 ArrayList (java.util.ArrayList)2 HashMap (java.util.HashMap)2 Test (org.junit.Test)2 Category (org.openlca.core.model.Category)2 ImpactMethod (org.openlca.core.model.ImpactMethod)2 Location (org.openlca.core.model.Location)2 Parameter (org.openlca.core.model.Parameter)2 ProductSystem (org.openlca.core.model.ProductSystem)2 SocialAspect (org.openlca.core.model.SocialAspect)2