Package org.eclipse.core.runtime

Examples of org.eclipse.core.runtime.IPath.toFile()


            } else {
                IResource resource = SelectionUtils.adaptObject(element, IResource.class);
                if (resource != null) {
                    IPath location = resource.getLocation();
                    if (location != null)
                        result.add(location.toFile());
                }
            }
        }
        return result;
    }
View Full Code Here


                result = new CnfInfo(Existence.ImportedOpen, location);
            else
                result = new CnfInfo(Existence.ImportedClosed, location);
        } else {
            IPath location = ResourcesPlugin.getWorkspace().getRoot().getLocation().append(Workspace.CNFDIR);
            File dir = location.toFile();

            if (dir.isDirectory())
                result = new CnfInfo(Existence.Exists, location);
            else
                result = new CnfInfo(Existence.None, location);
View Full Code Here

     *      the Modification Log filename
     */
    public static final String getModificationLogFileName( Connection connection )
    {
        IPath p = ConnectionCorePlugin.getDefault().getStateLocation().append( LOGS_PATH );
        File file = p.toFile();
        if ( !file.exists() )
        {
            file.mkdir();
        }
        return p.append( MODIFICATIONS_LOG_PREFIX + Utils.getFilenameString( connection.getId() ) + LDIFLOG_SUFFIX )
View Full Code Here

     *      the Search Log filename
     */
    public static final String getSearchLogFileName( Connection connection )
    {
        IPath p = ConnectionCorePlugin.getDefault().getStateLocation().append( LOGS_PATH ); //$NON-NLS-1$
        File file = p.toFile();
        if ( !file.exists() )
        {
            file.mkdir();
        }
        return p.append( SEARCH_LOGS_PREFIX + Utils.getFilenameString( connection.getId() ) + LDIFLOG_SUFFIX )
View Full Code Here

            if (projectRegistry == null) {

                // Load the resource through the editing domain.
                resourceSet = new ResourceSetImpl();

                if (registrypath.toFile().exists()) {
                    Resource resource = resourceSet.getResource(uri, true);
                    resourceSet.eSetDeliver(false);
                    projectRegistry = (ProjectRegistry) resource.getContents().get(0);
                    if (projectRegistry == null) {
                        projectRegistry = ProjectFactory.eINSTANCE.createProjectRegistry();
View Full Code Here

            IPath registrypath, URI uri) {
        IPath oldregistrypath = ProjectPlugin.getPlugin().getStateLocation()
                .append("ProjectRegistry"); //$NON-NLS-1$
        URI olduri = URI.createURI("file://" + oldregistrypath.toOSString()); //$NON-NLS-1$

        if (oldregistrypath.toFile().exists()) {
            resourceSet = new ResourceSetImpl();
            Resource resource = resourceSet.getResource(olduri, true);
            resourceSet.eSetDeliver(false);
            projectRegistry = (ProjectRegistry) resource.getContents().get(0);
View Full Code Here

            if (projectRegistry != null) {
                resourceSet = new ResourceSetImpl();
                resource = resourceSet.createResource(uri);
                resource.getContents().add(projectRegistry);
                oldregistrypath.toFile().deleteOnExit();
            }
        }
        return projectRegistry;
    }
View Full Code Here

    /**
     * Creates a new style manager pointing to the default preferences folder for style.
     */
    public LineStyleManager() {
        IPath stateLocation = StylePlugin.getDefault().getStateLocation();
        File stateLocationFile = stateLocation.toFile();

        styleFolderFile = new File(stateLocationFile, LINESTYLEFOLDER);
        if (!styleFolderFile.exists()) {
            styleFolderFile.mkdirs();
        }
View Full Code Here

    /**
     * Creates a new style manager pointing to the default preferences folder for style.
     */
    public PointStyleManager() {
        IPath stateLocation = StylePlugin.getDefault().getStateLocation();
        File stateLocationFile = stateLocation.toFile();

        styleFolderFile = new File(stateLocationFile, POINTSTYLEFOLDER);
        if (!styleFolderFile.exists()) {
            styleFolderFile.mkdirs();
        }
View Full Code Here

    /**
     * Creates a new style manager pointing to the default preferences folder for style.
     */
    public PolygonStyleManager() {
        IPath stateLocation = StylePlugin.getDefault().getStateLocation();
        File stateLocationFile = stateLocation.toFile();

        styleFolderFile = new File(stateLocationFile, POLYGONSTYLEFOLDER);
        if (!styleFolderFile.exists()) {
            styleFolderFile.mkdirs();
        }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.