| /** |
| * Copyright 2020-present NAVER Corp. |
| * |
| * Licensed under the Apache License, Version 2.0 (the "License"); |
| * you may not use this file except in compliance with the License. |
| * You may obtain a copy of the License at |
| * |
| * http://www.apache.org/licenses/LICENSE-2.0 |
| * |
| * Unless required by applicable law or agreed to in writing, software |
| * distributed under the License is distributed on an "AS IS" BASIS, |
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| * See the License for the specific language governing permissions and |
| * limitations under the License. |
| */ |
| |
| package com.navercorp.openwhisk.intellij.explorer.editor; |
| |
| import com.intellij.openapi.vfs.VirtualFile; |
| import com.intellij.openapi.vfs.VirtualFileListener; |
| import com.intellij.openapi.vfs.VirtualFileManager; |
| import com.intellij.openapi.vfs.VirtualFileSystem; |
| import org.jetbrains.annotations.NotNull; |
| import org.jetbrains.annotations.Nullable; |
| |
| import java.io.IOException; |
| |
| public class ActivationViewVirtualFileSystem extends VirtualFileSystem { |
| |
| private static final String PROTOCOL = "activation-view"; |
| |
| private static final IOException READONLY_FILE_SYSTEM = new IOException("Operation not support"); |
| |
| public ActivationViewVirtualFileSystem() { |
| } |
| |
| public static ActivationViewVirtualFileSystem getInstance() { |
| return (ActivationViewVirtualFileSystem) VirtualFileManager.getInstance().getFileSystem(PROTOCOL); |
| } |
| |
| @NotNull |
| @Override |
| public String getProtocol() { |
| return PROTOCOL; |
| } |
| |
| @Nullable |
| @Override |
| public VirtualFile findFileByPath(@NotNull String path) { |
| return null; |
| } |
| |
| @Override |
| public void refresh(boolean asynchronous) { |
| |
| } |
| |
| @Nullable |
| @Override |
| public VirtualFile refreshAndFindFileByPath(@NotNull String path) { |
| return null; |
| } |
| |
| @Override |
| public void addVirtualFileListener(@NotNull VirtualFileListener listener) { |
| |
| } |
| |
| @Override |
| public void removeVirtualFileListener(@NotNull VirtualFileListener listener) { |
| |
| } |
| |
| @Override |
| protected void deleteFile(Object requestor, @NotNull VirtualFile vFile) throws IOException { |
| |
| } |
| |
| @Override |
| protected void moveFile(Object requestor, @NotNull VirtualFile vFile, @NotNull VirtualFile newParent) throws IOException { |
| |
| } |
| |
| @Override |
| protected void renameFile(Object requestor, @NotNull VirtualFile vFile, @NotNull String newName) throws IOException { |
| |
| } |
| |
| @NotNull |
| @Override |
| protected VirtualFile createChildFile(Object requestor, @NotNull VirtualFile vDir, @NotNull String fileName) throws IOException { |
| throw READONLY_FILE_SYSTEM; |
| } |
| |
| @NotNull |
| @Override |
| protected VirtualFile createChildDirectory(Object requestor, @NotNull VirtualFile vDir, @NotNull String dirName) throws IOException { |
| throw READONLY_FILE_SYSTEM; |
| } |
| |
| @NotNull |
| @Override |
| protected VirtualFile copyFile(Object requestor, |
| @NotNull VirtualFile virtualFile, |
| @NotNull VirtualFile newParent, |
| @NotNull String copyName) throws IOException { |
| throw READONLY_FILE_SYSTEM; |
| } |
| |
| @Override |
| public boolean isReadOnly() { |
| return false; |
| } |
| } |