File tree Expand file tree Collapse file tree 1 file changed +21
-1
lines changed
app/display/runtime/src/main/java/org/csstudio/display/builder/runtime/app Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change 1313import java .net .URI ;
1414import java .net .URISyntaxException ;
1515import java .net .URLEncoder ;
16+ import java .util .Locale ;
1617import java .util .logging .Level ;
1718
1819import org .csstudio .display .builder .model .DisplayModel ;
@@ -112,7 +113,26 @@ private static String basename(final String path)
112113 */
113114 public static DisplayInfo forModel (final DisplayModel model )
114115 {
115- return new DisplayInfo (model .getUserData (DisplayModel .USER_DATA_INPUT_FILE ),
116+ String path ;
117+ {
118+ String userDataInputFile = model .getUserData (DisplayModel .USER_DATA_INPUT_FILE );
119+ String userDataInputFile_lowerCase = userDataInputFile .toLowerCase (Locale .ROOT );
120+ if ( !userDataInputFile_lowerCase .startsWith ("/" )
121+ && !userDataInputFile_lowerCase .startsWith ("examples:" )
122+ && !userDataInputFile_lowerCase .startsWith ("file:" )
123+ && !userDataInputFile_lowerCase .startsWith ("http:" )
124+ && !userDataInputFile_lowerCase .startsWith ("https:" )
125+ && !userDataInputFile_lowerCase .startsWith ("ftp:" )
126+ && !userDataInputFile_lowerCase .startsWith ("jar:" )) {
127+ // Add leading '/' and replace occurrences of '\' by '/' in the file path on Windows:
128+ path = "/" + userDataInputFile .replace ('\\' , '/' );
129+ }
130+ else {
131+ path = userDataInputFile ;
132+ }
133+ }
134+
135+ return new DisplayInfo (path ,
116136 model .getDisplayName (),
117137 model .propMacros ().getValue (),
118138 false );
You can’t perform that action at this time.
0 commit comments