Package org.eclipse.osgi.service.datalocation

Examples of org.eclipse.osgi.service.datalocation.Location


}
//--------------------------------------------------------------------------------
public void loadConfig()
throws IOException
{
Location location = Platform.getConfigurationLocation();
if( location != null )
  {
  URL configURL = location.getURL();
  if( configURL != null
   && configURL.getProtocol().startsWith( "file" ) )
    {
    File platformDir = new File( configURL.getFile(), Activator.PLUGIN_ID );
    MSystemUtil.createDir( platformDir.getAbsolutePath() );
View Full Code Here


  public void checkLogErrors() throws Throwable {
    checkLogErrors_();
  }
 
  private static void initializeWorkingDirToEclipseInstanceLocation() {
    Location instanceLocation = Platform.getInstanceLocation();
    try {
      URI uri = instanceLocation.getURL().toURI();
      Path workingDirPath = new File(uri).toPath().toAbsolutePath().resolve("TestsWD");
      TestsWorkingDir.initWorkingDir(workingDirPath.toString());
    } catch (URISyntaxException e) {
      throw assertFail();
    }
View Full Code Here

    PlatformURLPluginConnection.startup();
    PlatformURLFragmentConnection.startup();
    PlatformURLMetaConnection.startup();
    PlatformURLConfigConnection.startup();

    Location service = getInstallLocation();
    if (service != null)
      PlatformURLBaseConnection.startup(service.getURL());

    Hashtable properties = new Hashtable(1);
    properties.put(URLConstants.URL_HANDLER_PROTOCOL, new String[] {PlatformURLHandler.PROTOCOL});
    getContext().registerService(URLStreamHandlerService.class.getName(), new PlatformURLHandler(), properties);
  }
View Full Code Here

    String path = spec.substring(CONFIG.length() + 1);
    // resolution takes parent configuration into account (if it exists)
    Activator activator = Activator.getDefault();
    if (activator == null)
      throw new IOException(CommonMessages.activator_not_available);
    Location localConfig = activator.getConfigurationLocation();
    Location parentConfig = localConfig.getParentLocation();
    // assume we will find the file locally
    URL localURL = new URL(localConfig.getURL(), path);
    if (!FILE_PROTOCOL.equals(localURL.getProtocol()) || parentConfig == null)
      // we only support cascaded file: URLs
      return localURL;
    File localFile = new File(localURL.getPath());
    if (localFile.exists())
      // file exists in local configuration
      return localURL;
    // try to find in the parent configuration
    URL parentURL = new URL(parentConfig.getURL(), path);
    if (FILE_PROTOCOL.equals(parentURL.getProtocol())) {
      // we only support cascaded file: URLs     
      File parentFile = new File(parentURL.getPath());
      if (parentFile.exists()) {
        // parent has the location
View Full Code Here

    if (location != null && initialized)
      return;
    Activator activator = Activator.getDefault();
    if (activator == null)
      throw new IllegalStateException(CommonMessages.activator_not_available);
    Location service = activator.getInstanceLocation();
    if (service == null)
      throw new IllegalStateException(CommonMessages.meta_noDataModeSpecified);
    try {
      URL url = service.getURL();
      if (url == null)
        throw new IllegalStateException(CommonMessages.meta_instanceDataUnspecified);
      // TODO assume the URL is a file:
      // Use the new File technique to ensure that the resultant string is
      // in the right format (e.g., leading / removed from /c:/foo etc)
View Full Code Here

    @Override
    public Object start( final IApplicationContext context ) throws Exception
    {
        try
        {
            Location workspaceLocation = Platform.getInstanceLocation();
            if ( !workspaceLocation.isSet() )
            {
                Location installLocation = Platform.getInstallLocation();
                String dataPath = installLocation.getURL().getPath() + "neoclipse-workspace" + File.separator;
                File dir = new File( dataPath );
                if ( !dir.exists() )
                {
                    if ( !dir.mkdirs() )
                    {
View Full Code Here

    }

    private static File getFile( String fileExtention )
    {

        Location installLocation = Platform.getInstallLocation();
        String startingDirectory = installLocation.getURL().getPath() + "neoclipse-workspace/data" + File.separator;
        File dir = new File( startingDirectory );
        if ( !dir.exists() )
        {
            if ( !dir.mkdirs() )
            {
View Full Code Here

      // ignore this. It should never happen as we have tested the above
      // format.
    }
    final ServiceTracker instanceLocationTracker = new ServiceTracker(context, filter, null);
    instanceLocationTracker.open();
    final Location l = (Location) instanceLocationTracker.getService();
    instanceLocationTracker.close();
    if (l == null)
      return null;

    final Path path = new Path(l.getURL().getPath());
    return path.append(F_META_AREA).append(F_PLUGIN_DATA).append(context.getBundle().getSymbolicName()).toFile();
  }
View Full Code Here

  }

  private MApplication loadApplicationModel(IApplicationContext appContext, IEclipseContext eclipseContext) {
    MApplication theApp = null;

    Location instanceLocation = WorkbenchJFXActivator.getDefault().getInstanceLocation();

    String appModelPath = getArgValue(E4Workbench.XMI_URI_ARG, appContext, false);
    Assert.isNotNull(appModelPath, E4Workbench.XMI_URI_ARG + " argument missing"); //$NON-NLS-1$
    final URI initialWorkbenchDefinitionInstance = URI.createPlatformPluginURI(appModelPath, true);
View Full Code Here

      return null;
    }
  }

  private static void writeWorkspaceVersion() {
    Location instanceLoc = Platform.getInstanceLocation();
    if (instanceLoc == null || instanceLoc.isReadOnly()) {
      return;
    }

    File versionFile = getVersionFile(instanceLoc.getURL(), true);
    if (versionFile == null) {
      return;
    }

    OutputStream output = null;
View Full Code Here

TOP

Related Classes of org.eclipse.osgi.service.datalocation.Location

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.