Ignore:
Timestamp:
09/19/11 10:39:55 (13 years ago)
Author:
gaba
Message:

Utils.java in place of Helpers and Admin
Diagnostics changes in GenericAction?
code arrangement, comments

File:
1 edited

Legend:

Unmodified
Added
Removed
  • MDService2/branches/MDService_simple3/src/eu/clarin/cmdi/mdservice/model/WorkspaceProfile.java

    r1538 r1540  
    1111import net.sf.json.JSONArray;
    1212import net.sf.json.JSONObject;
    13 import eu.clarin.cmdi.mdservice.internal.Admin;
    14 import eu.clarin.cmdi.mdservice.action.GenericProxyAction;
    15 import eu.clarin.cmdi.mdservice.internal.Helpers;
    1613import eu.clarin.cmdi.mdservice.internal.MDTransformer;
     14import eu.clarin.cmdi.mdservice.internal.Utils;
    1715import eu.clarin.cmdi.mdservice.action.WorkspaceAction;
    1816import eu.clarin.cmdi.mdservice.internal.NoStylesheetException;
     
    220218
    221219        public static JSONArray createRepositories() throws IOException, InterruptedException, TransformerException, NoStylesheetException{
    222                 String path = Admin.getConfig().getProperty("workspaceprofile.path") + WorkspaceAction.WORKSPACE_FILENAME;//PROFILENAME_SERVER;
     220                String path = Utils.getConfig().getProperty("workspaceprofile.path") + WorkspaceAction.WORKSPACE_FILENAME;//PROFILENAME_SERVER;
    223221                File file=new File(path);
    224222                InputStream in  = new BufferedInputStream( new FileInputStream(path));;
     
    229227                InputStream jsonstream = transformer.transformXML(in);
    230228               
    231                 JSONObject json = JSONObject.fromObject(Helpers.convertStreamToString(jsonstream));
     229                JSONObject json = JSONObject.fromObject(Utils.streamToString(jsonstream));
    232230                JSONArray wparray = json.getJSONObject("Profiles").getJSONArray("WorkspaceProfiles");
    233231                JSONArray array = null;
     
    254252       
    255253        public static JSONObject createOptions() throws IOException, InterruptedException, TransformerException, NoStylesheetException{
    256                 String path = Admin.getConfig().getProperty("workspaceprofile.path") + WorkspaceAction.WORKSPACE_FILENAME;//PROFILENAME_SERVER;
     254                String path = Utils.getConfig().getProperty("workspaceprofile.path") + WorkspaceAction.WORKSPACE_FILENAME;//PROFILENAME_SERVER;
    257255                File file=new File(path);
    258256                InputStream in  = new BufferedInputStream( new FileInputStream(path));;
     
    263261                InputStream jsonstream = transformer.transformXML(in);
    264262               
    265                 JSONObject json = JSONObject.fromObject(Helpers.convertStreamToString(jsonstream));
     263                JSONObject json = JSONObject.fromObject(Utils.streamToString(jsonstream));
    266264                JSONArray wparray = json.getJSONObject("Profiles").getJSONArray("WorkspaceProfiles");
    267265                JSONObject obj = null;
     
    306304       
    307305        public static JSONArray createTermsets() throws IOException, InterruptedException, TransformerException, NoStylesheetException{
    308                 String path = Admin.getConfig().getProperty("workspaceprofile.path") + WorkspaceAction.WORKSPACE_FILENAME;//PROFILENAME_SERVER;
     306                String path = Utils.getConfig().getProperty("workspaceprofile.path") + WorkspaceAction.WORKSPACE_FILENAME;//PROFILENAME_SERVER;
    309307                File file=new File(path);
    310308                InputStream in  = new BufferedInputStream( new FileInputStream(path));;
     
    315313                InputStream jsonstream = transformer.transformXML(in);
    316314               
    317                 JSONObject json = JSONObject.fromObject(Helpers.convertStreamToString(jsonstream));
     315                JSONObject json = JSONObject.fromObject(Utils.streamToString(jsonstream));
    318316                JSONArray wparray = json.getJSONObject("Profiles").getJSONArray("WorkspaceProfiles");
    319317                JSONArray array = null;
Note: See TracChangeset for help on using the changeset viewer.