Search in sources :

Example 1 with RemoteFile

use of com.intellij.remote.RemoteFile in project intellij-community by JetBrains.

the class PyRemotePackageManagerImpl method getHelperPath.

@Nullable
@Override
protected String getHelperPath(String helper) throws ExecutionException {
    final Sdk sdk = getSdk();
    final SdkAdditionalData sdkData = sdk.getSdkAdditionalData();
    if (sdkData instanceof PyRemoteSdkAdditionalDataBase) {
        final PyRemoteSdkAdditionalDataBase remoteSdkData = (PyRemoteSdkAdditionalDataBase) sdkData;
        try {
            String helpersPath;
            if (CaseCollector.useRemoteCredentials(remoteSdkData)) {
                final RemoteSdkCredentials remoteSdkCredentials = remoteSdkData.getRemoteSdkCredentials(false);
                helpersPath = remoteSdkCredentials.getHelpersPath();
            } else {
                helpersPath = remoteSdkData.getHelpersPath();
            }
            if (!StringUtil.isEmpty(helpersPath)) {
                return new RemoteFile(helpersPath, helper).getPath();
            } else {
                return null;
            }
        } catch (InterruptedException e) {
            LOG.error(e);
        } catch (ExecutionException e) {
            throw analyzeException(e, helper, Collections.<String>emptyList());
        }
    }
    return null;
}
Also used : PyRemoteSdkAdditionalDataBase(com.jetbrains.python.remote.PyRemoteSdkAdditionalDataBase) Sdk(com.intellij.openapi.projectRoots.Sdk) ExecutionException(com.intellij.execution.ExecutionException) RemoteFile(com.intellij.remote.RemoteFile) RemoteSdkAdditionalData(com.intellij.remote.RemoteSdkAdditionalData) SdkAdditionalData(com.intellij.openapi.projectRoots.SdkAdditionalData) RemoteSdkCredentials(com.intellij.remote.RemoteSdkCredentials) Nullable(org.jetbrains.annotations.Nullable)

Aggregations

ExecutionException (com.intellij.execution.ExecutionException)1 Sdk (com.intellij.openapi.projectRoots.Sdk)1 SdkAdditionalData (com.intellij.openapi.projectRoots.SdkAdditionalData)1 RemoteFile (com.intellij.remote.RemoteFile)1 RemoteSdkAdditionalData (com.intellij.remote.RemoteSdkAdditionalData)1 RemoteSdkCredentials (com.intellij.remote.RemoteSdkCredentials)1 PyRemoteSdkAdditionalDataBase (com.jetbrains.python.remote.PyRemoteSdkAdditionalDataBase)1 Nullable (org.jetbrains.annotations.Nullable)1