Examples of PlatformDependentTools


Examples of net.ishchenko.idea.nginx.platform.PlatformDependentTools

        VirtualFile executableVirtualFile = LocalFileSystem.getInstance().findFileByPath(descriptorCopy.getExecutablePath());
        if (executableVirtualFile == null || executableVirtualFile.isDirectory()) {
            throw new ExecutionException(NginxBundle.message("run.error.badpath", descriptorCopy.getExecutablePath()));
        }

        PlatformDependentTools pdt = ApplicationManager.getApplication().getComponent(PlatformDependentTools.class);

        ProcessBuilder builder = new ProcessBuilder(pdt.getStartCommand(descriptorCopy));
        builder.directory(new File(executableVirtualFile.getParent().getPath()));
        try {
            return new NginxProcessHandler(builder.start(), StringUtil.join(pdt.getStartCommand(descriptorCopy), " "), descriptorCopy.clone());
        } catch (IOException e) {
            throw new ExecutionException(e.getMessage(), e);
        }

    }
View Full Code Here

Examples of net.ishchenko.idea.nginx.platform.PlatformDependentTools

        }
    }

    private boolean tryToStop() {

        PlatformDependentTools pdt = ApplicationManager.getApplication().getComponent(PlatformDependentTools.class);
        VirtualFile executableVirtualFile = LocalFileSystem.getInstance().findFileByPath(descriptorCopy.getExecutablePath());
        String[] stopCommand = pdt.getStopCommand(descriptorCopy);
        ProcessBuilder builder = new ProcessBuilder(stopCommand);
        builder.directory(new File(executableVirtualFile.getParent().getPath()));
        boolean successfullyStopped = false;
        try {
            OSProcessHandler osph = new OSProcessHandler(builder.start(), StringUtil.join(stopCommand, " "));
View Full Code Here

Examples of net.ishchenko.idea.nginx.platform.PlatformDependentTools

    }

    private void testConfig(final NginxServerDescriptor descriptor, final ConsoleView console, Project project) throws ReloadException, IOException {

        VirtualFile executableFile = LocalFileSystem.getInstance().findFileByPath(descriptor.getExecutablePath());
        PlatformDependentTools pdt = ApplicationManager.getApplication().getComponent(PlatformDependentTools.class);
        String[] testCommand = pdt.getTestCommand(descriptor);
        int exitValue = runAndGetExitValue(testCommand, new File(executableFile.getParent().getPath()), console);

        if (exitValue != 0) {
            throw new ReloadException(NginxBundle.message("run.validationfailed"));
        }
View Full Code Here

Examples of net.ishchenko.idea.nginx.platform.PlatformDependentTools

    }

    private void doReload(NginxServerDescriptor descriptor, ConsoleView console, Project project) throws ReloadException, IOException {

        VirtualFile executableFile = LocalFileSystem.getInstance().findFileByPath(descriptor.getExecutablePath());
        PlatformDependentTools pdt = ApplicationManager.getApplication().getComponent(PlatformDependentTools.class);
        String[] reloadCommand = pdt.getReloadCommand(descriptor);
        int exitValue = runAndGetExitValue(reloadCommand, new File(executableFile.getParent().getPath()), console);

        if (exitValue != 0) {
            throw new ReloadException(NginxBundle.message("run.validationfailed"));
        }
View Full Code Here

Examples of net.ishchenko.idea.nginx.platform.PlatformDependentTools

        VirtualFile vfile = LocalFileSystem.getInstance().findFileByPath(descriptor.getExecutablePath());
        if (vfile == null) {
            throw new RuntimeConfigurationException(NginxBundle.message("run.error.badpath"));
        } else {

            PlatformDependentTools pdt = ApplicationManager.getApplication().getComponent(PlatformDependentTools.class);
            if (!pdt.checkExecutable(vfile)) {
                throw new RuntimeConfigurationException(NginxBundle.message("run.error.notexecutable"));
            }

        }
View Full Code Here

Examples of net.ishchenko.idea.nginx.platform.PlatformDependentTools

        serverList.setModel(model);
    }

    public synchronized void apply() throws ConfigurationException {

        PlatformDependentTools pdt = ApplicationManager.getApplication().getComponent(PlatformDependentTools.class);
        for (int i = 0; i < serverList.getModel().getSize(); i++) {
            NginxServerDescriptor descriptor = (NginxServerDescriptor) serverList.getModel().getElementAt(i);
            if (!pdt.checkExecutable(descriptor.getExecutablePath())) {
                serverList.setSelectedIndex(i);
                throw new ConfigurationException(NginxBundle.message("run.error.badpath"));
            }
        }
View Full Code Here

Examples of net.ishchenko.idea.nginx.platform.PlatformDependentTools

        VirtualFile vfile = LocalFileSystem.getInstance().findFileByPath(descriptor.getExecutablePath());
        if (vfile == null) {
            throw new RuntimeConfigurationException(NginxBundle.message("run.error.badpath"));
        } else {

            PlatformDependentTools pdt = ApplicationManager.getApplication().getComponent(PlatformDependentTools.class);
            if (!pdt.checkExecutable(vfile)) {
                throw new RuntimeConfigurationException(NginxBundle.message("run.error.notexecutable"));
            }

        }
View Full Code Here

Examples of net.ishchenko.idea.nginx.platform.PlatformDependentTools

        serverList.setModel(model);
    }

    public synchronized void apply() throws ConfigurationException {

        PlatformDependentTools pdt = ApplicationManager.getApplication().getComponent(PlatformDependentTools.class);
        for (int i = 0; i < serverList.getModel().getSize(); i++) {
            NginxServerDescriptor descriptor = (NginxServerDescriptor) serverList.getModel().getElementAt(i);
            if (!pdt.checkExecutable(descriptor.getExecutablePath())) {
                serverList.setSelectedIndex(i);
                throw new ConfigurationException(NginxBundle.message("run.error.badpath"));
            }
        }
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.