|
28 | 28 | import com.scudata.dm.DataStruct; |
29 | 29 | import com.scudata.dm.Env; |
30 | 30 | import com.scudata.dm.FileObject; |
| 31 | +import com.scudata.dm.JobSpace; |
31 | 32 | import com.scudata.dm.Param; |
32 | 33 | import com.scudata.dm.Record; |
33 | 34 | import com.scudata.dm.Sequence; |
@@ -2993,6 +2994,16 @@ public SimpleSelect(ICellSet ics, Context ctx) |
2993 | 2994 | init(); |
2994 | 2995 | } |
2995 | 2996 |
|
| 2997 | + public static File getAppHome(Context ctx) { |
| 2998 | + if (ctx != null) { |
| 2999 | + JobSpace js = ctx.getJobSpace(); |
| 3000 | + if (js != null) return js.getAppHome(); |
| 3001 | + } |
| 3002 | + |
| 3003 | + return null; |
| 3004 | + } |
| 3005 | + |
| 3006 | + |
2996 | 3007 | private void init() |
2997 | 3008 | { |
2998 | 3009 | this.hasDistinct = false; |
@@ -3702,13 +3713,17 @@ else if(this.tmd != null) |
3702 | 3713 | } |
3703 | 3714 |
|
3704 | 3715 | boolean fileExists = false; |
| 3716 | + File f = new File(""); |
| 3717 | + |
3705 | 3718 | //System.out.println("tableName " + tableName); |
3706 | | - File[] fs = FileUtil.getFiles(tableName); |
| 3719 | + File appHome = getAppHome(ctx); |
| 3720 | + //.getAbsolutePath(); |
| 3721 | + File[] fs = FileUtil.getFiles((appHome != null?appHome.getAbsolutePath()+"/":"")+tableName); |
3707 | 3722 | if (fs == null) { |
3708 | | - fs = FileUtil.getFiles(Env.getMainPath()+"/"+tableName); |
| 3723 | + fs = FileUtil.getFiles((appHome != null?appHome.getAbsolutePath()+"/":"")+Env.getMainPath()+"/"+tableName); |
3709 | 3724 | if (fs == null && Env.getPaths() != null) { |
3710 | 3725 | for (int i=0; i<Env.getPaths().length; i++) { |
3711 | | - fs = FileUtil.getFiles(Env.getPaths()[i]+"/"+tableName); |
| 3726 | + fs = FileUtil.getFiles((appHome != null?appHome.getAbsolutePath()+"/":"")+Env.getPaths()[i]+"/"+tableName); |
3712 | 3727 | if (fs != null) break; |
3713 | 3728 | } |
3714 | 3729 | } |
|
0 commit comments