Package com.codeberry.jdatapath

Examples of com.codeberry.jdatapath.DataPath


import com.codeberry.jdatapath.LocalDataPathSystem;

public class UnknownSystem implements LocalDataPathSystem {
  public DataPath getLocalDataPath(String wantedDataDirName) {
    String userHome = System.getProperty("user.home");
    return new DataPath(userHome + JDataPathSystem.getFileSeparator() + "." + wantedDataDirName, false);
  }
View Full Code Here


    String userHome = System.getProperty("user.home");
    return new DataPath(userHome + JDataPathSystem.getFileSeparator() + "." + wantedDataDirName, false);
  }

  public DataPath getUserProfilePath() {
    return new DataPath(System.getProperty("user.home"), false);
  }
View Full Code Here

import java.lang.instrument.Instrumentation;

public class Main {
  public static void premain(String agentArguments, Instrumentation instrumentation) {
    DataPath path = JDataPathSystem.getLocalSystem().getUserProfilePath();

    String userHome = System.getProperty("user.home");
    try {
      if (userHome.equals(path.getPath())) {
        System.err.println("*** JDataPath: Not Assigned 'user.home' (as expected): " + path.getPath());
      } else {
        System.setProperty("user.home", path.getPath());
        System.err.println("*** JDataPath: OK Assigned 'user.home': " + path.getPath());
      }
    } catch (Exception e) {
      e.printStackTrace();
      System.err.println("*** JDataPath: Failed Assigned 'user.home': " + path.getPath());
    }
  }
View Full Code Here

    }
  }

  public DataPath getLocalDataPath(String wantedDataDirName) {
    String mainPath = getPath(CCIDL.CSIDL_LOCAL_APPDATA);
    return new DataPath(mainPath + JDataPathSystem.getFileSeparator() + wantedDataDirName, true);
  }
View Full Code Here

    String mainPath = getPath(CCIDL.CSIDL_LOCAL_APPDATA);
    return new DataPath(mainPath + JDataPathSystem.getFileSeparator() + wantedDataDirName, true);
  }

  public DataPath getUserProfilePath() {
    return new DataPath(getPath(CCIDL.CSIDL_PROFILE), true);
  }
View Full Code Here

                // NOTE(SM): finding the "local data app" in windows from java is actually a PITA
                // see http://stackoverflow.com/questions/1198911/how-to-get-local-application-data-folder-in-java
                // so we're using a library that uses JNI to ask directly the win32 APIs,
                // it's not elegant but it's the safest bet.
               
                DataPath localDataPath = JDataPathSystem.getLocalSystem().getLocalDataPath("Google");

                // new: ./Google/Refine old: ./Gridworks
                dataDir = new File(new File(fixWindowsUnicodePath(localDataPath.getPath())), "Refine");
                gridworksDir = new File(fixWindowsUnicodePath(JDataPathSystem.getLocalSystem()
                        .getLocalDataPath("Gridworks").getPath()));
            } catch (Error e) {
                /*
                 *  The above trick can fail, particularly on a 64-bit OS as the jdatapath.dll
View Full Code Here

TOP

Related Classes of com.codeberry.jdatapath.DataPath

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.