Ignore:
Timestamp:
03/24/20 09:40:55 (4 years ago)
Author:
bnemhaus
Message:

Added ability to have ${EXPEDITEE.HOME} used in @File annotations.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/expeditee/gui/management/ResourceUtil.java

    r1447 r1524  
    2222        public static final String CURRENT_FRAMESET_FLAG = "${CURRENT_FRAMESET}";
    2323        public static final String CURRENT_USER = "${CURRENT_USER}";
     24        public static final String EXPEDITEE_HOME = "${EXPEDITEE_HOME}";
    2425       
    2526        /**
     
    6768                Text item = DisplayController.getCurrentFrame().createNewText("@i: " + out.getName());
    6869                return item;
     70        }
     71       
     72        public static Path resolveResourcePath(String unresolved, Frame context) {
     73                Path expediteeHome = Paths.get(FrameIO.PARENT_FOLDER).toAbsolutePath();
     74                Path absolutePath = Paths.get(context.getFramesetPath()).toAbsolutePath();
     75                Path p = expediteeHome.relativize(absolutePath);
     76                String resolved = ResourceUtil.substitute(unresolved, CURRENT_FRAMESET_FLAG, p.toString());
     77                resolved = ResourceUtil.substitute(resolved, EXPEDITEE_HOME, expediteeHome.toString());
     78                return Paths.get(resolved).toAbsolutePath();
    6979        }
    7080       
Note: See TracChangeset for help on using the changeset viewer.