This is an automated email from the ASF dual-hosted git repository.
riemer pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/incubator-streampipes.git
The following commit(s) were added to refs/heads/dev by this push:
new 54d29f2 [STREAMPIPES-217] Remove obsolete file resources and views
54d29f2 is described below
commit 54d29f277a5f128b213e033fa4b03349579913bb
Author: Dominik Riemer <[email protected]>
AuthorDate: Tue Sep 15 21:20:32 2020 +0200
[STREAMPIPES-217] Remove obsolete file resources and views
---
.../init/AdapterMasterContainerResourceConfig.java | 14 +--
.../master/management/FileManagement.java | 79 --------------
.../container/master/rest/FileResource.java | 114 ---------------------
.../init/AdapterWorkerContainerResourceConfig.java | 11 +-
.../worker/management/FileManagement.java | 89 ----------------
.../container/worker/rest/FileResource.java | 104 -------------------
.../data-marketplace.component.html | 9 +-
.../file-management/file-management.component.css | 18 ----
.../file-management/file-management.component.html | 43 --------
.../file-management/file-management.component.ts | 94 -----------------
ui/src/app/connect/connect.module.ts | 8 --
ui/src/app/connect/services/filerest.service.ts | 74 -------------
12 files changed, 5 insertions(+), 652 deletions(-)
diff --git
a/streampipes-connect-container-master/src/main/java/org/apache/streampipes/connect/container/master/init/AdapterMasterContainerResourceConfig.java
b/streampipes-connect-container-master/src/main/java/org/apache/streampipes/connect/container/master/init/AdapterMasterContainerResourceConfig.java
index 9496f87..19dd790 100644
---
a/streampipes-connect-container-master/src/main/java/org/apache/streampipes/connect/container/master/init/AdapterMasterContainerResourceConfig.java
+++
b/streampipes-connect-container-master/src/main/java/org/apache/streampipes/connect/container/master/init/AdapterMasterContainerResourceConfig.java
@@ -17,20 +17,11 @@
*/
package org.apache.streampipes.connect.container.master.init;
+import org.apache.streampipes.connect.container.master.rest.*;
+import org.apache.streampipes.connect.init.AdapterContainerConfig;
import
org.apache.streampipes.rest.shared.serializer.JacksonSerializationProvider;
import org.glassfish.jersey.media.multipart.MultiPartFeature;
import org.springframework.stereotype.Component;
-import org.apache.streampipes.connect.container.master.rest.AdapterResource;
-import
org.apache.streampipes.connect.container.master.rest.AdapterTemplateResource;
-import
org.apache.streampipes.connect.container.master.rest.DescriptionResource;
-import org.apache.streampipes.connect.container.master.rest.FileResource;
-import org.apache.streampipes.connect.container.master.rest.GuessResource;
-import
org.apache.streampipes.connect.container.master.rest.RuntimeResolvableResource;
-import org.apache.streampipes.connect.container.master.rest.SourcesResource;
-import org.apache.streampipes.connect.container.master.rest.UnitResource;
-import org.apache.streampipes.connect.container.master.rest.WelcomePageMaster;
-import
org.apache.streampipes.connect.container.master.rest.WorkerAdministrationResource;
-import org.apache.streampipes.connect.init.AdapterContainerConfig;
@Component
@@ -44,7 +35,6 @@ public class AdapterMasterContainerResourceConfig extends
AdapterContainerConfig
register(DescriptionResource.class);
register(SourcesResource.class);
register(GuessResource.class);
- register(FileResource.class);
register(MultiPartFeature.class);
register(UnitResource.class);
register(WorkerAdministrationResource.class);
diff --git
a/streampipes-connect-container-master/src/main/java/org/apache/streampipes/connect/container/master/management/FileManagement.java
b/streampipes-connect-container-master/src/main/java/org/apache/streampipes/connect/container/master/management/FileManagement.java
deleted file mode 100644
index 72af744..0000000
---
a/streampipes-connect-container-master/src/main/java/org/apache/streampipes/connect/container/master/management/FileManagement.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.streampipes.connect.container.master.management;
-
-import org.apache.streampipes.connect.adapter.exception.AdapterException;
-import org.apache.streampipes.model.connect.worker.ConnectWorkerContainer;
-import
org.apache.streampipes.storage.couchdb.impl.ConnectionWorkerContainerStorageImpl;
-
-import java.io.InputStream;
-import java.util.LinkedList;
-import java.util.List;
-
-public class FileManagement {
-
- private ConnectionWorkerContainerStorageImpl
connectionWorkerContainerStorage;
-
- public FileManagement() {
- this.connectionWorkerContainerStorage = new
ConnectionWorkerContainerStorageImpl();
- }
-
- public String saveFileAtWorker(String appId, InputStream inputStream, String
fileName, String userName) throws AdapterException {
- appId = appId.replaceAll("sp:",
"https://streampipes.org/vocabulary/v1/");
-
- String workerUrl = new Utils().getWorkerUrlById(appId);
- String newUrl = Utils.addUserNameToApi(workerUrl, userName);
- return WorkerRestClient.saveFileAtWorker(newUrl, inputStream, fileName);
- }
-
-
- public List<String> getAllFilePathsFromWorker(String username) throws
AdapterException {
- List<String> filePaths = new LinkedList<>();
-
- //TODO: if have more than connect-worker: add information from which
container is the file
- List<ConnectWorkerContainer> allConnectWorkerContainer =
this.connectionWorkerContainerStorage.getAllConnectWorkerContainers();
- for (ConnectWorkerContainer connectWorkerContainer :
allConnectWorkerContainer) {
- String workerUrl = connectWorkerContainer.getEndpointUrl();
- String newUrl = Utils.addUserNameToApi(workerUrl, username);
- List<String> paths =
WorkerRestClient.getAllFilePathsFromWorker(newUrl);
- filePaths.addAll(paths);
- }
-
- return filePaths;
- }
-
- public InputStream getFileFromWorker(String appId, String fileName, String
userName) throws AdapterException {
- String workerUrl = new Utils().getWorkerUrlById(appId);
- String newUrl = Utils.addUserNameToApi(workerUrl, userName);
- return WorkerRestClient.getFileFromWorker(newUrl, fileName);
- }
-
-
- public void deleteFileFromWorker(String appId, String fileName, String
userName) throws AdapterException {
- appId = appId.replaceAll("sp:",
"https://streampipes.org/vocabulary/v1/");
-
- //TODO: if have more than connect-worker: use 'app-id' information to
find the correct connect-container
- List<ConnectWorkerContainer> allConnectWorkerContainer =
this.connectionWorkerContainerStorage.getAllConnectWorkerContainers();
- String workerUrl = allConnectWorkerContainer.get(0).getEndpointUrl();
- //String workerUrl = new Utils().getWorkerUrlById(appId);
- String newUrl = Utils.addUserNameToApi(workerUrl, userName);
- WorkerRestClient.deleteFileFromWorker(newUrl, fileName);
- }
-
-}
diff --git
a/streampipes-connect-container-master/src/main/java/org/apache/streampipes/connect/container/master/rest/FileResource.java
b/streampipes-connect-container-master/src/main/java/org/apache/streampipes/connect/container/master/rest/FileResource.java
deleted file mode 100644
index 2c2cf91..0000000
---
a/streampipes-connect-container-master/src/main/java/org/apache/streampipes/connect/container/master/rest/FileResource.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.streampipes.connect.container.master.rest;
-
-import org.glassfish.jersey.media.multipart.FormDataContentDisposition;
-import org.glassfish.jersey.media.multipart.FormDataParam;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.apache.streampipes.connect.adapter.exception.AdapterException;
-import
org.apache.streampipes.connect.container.master.management.FileManagement;
-import org.apache.streampipes.connect.rest.AbstractContainerResource;
-
-import java.io.InputStream;
-
-import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-
-@Path("/api/v1/{username}/master/file")
-public class FileResource extends AbstractContainerResource {
-
- private Logger logger = LoggerFactory.getLogger(FileResource.class);
-
- FileManagement fileManagement;
-
- public FileResource() {
- this.fileManagement = new FileManagement();
- }
-
- public FileResource(FileManagement fileManagement) {
- this.fileManagement = fileManagement;
- }
-
- @POST
- @Consumes(MediaType.MULTIPART_FORM_DATA)
- public Response addFileForAdapter(@PathParam("username") String username,
- @FormDataParam("appId") String id,
- @FormDataParam("file_upload")
InputStream uploadedInputStream,
- @FormDataParam("file_upload")
FormDataContentDisposition fileDetail) {
-
- try {
- String filePath = fileManagement.saveFileAtWorker(id,
uploadedInputStream, fileDetail.getFileName(), username);
- return ok(filePath);
-// return ok(Notifications.success(filePath));
- } catch (Exception e) {
- logger.error(e.toString());
- return fail();
- }
- }
-
- @GET
- @Path("/{appId}/{filename}")
- public Response getFileFromWorker(@PathParam("appId") String id,
@PathParam("filename") String fileName,
- @PathParam("username") String
username) {
- try {
- InputStream fileStream = fileManagement.getFileFromWorker(id,
fileName, username);
- return Response.ok(fileStream, MediaType.APPLICATION_OCTET_STREAM)
- .header("Content-Disposition", "attachment; filename=\"" +
fileName + "\"")
- .build();
- } catch (AdapterException e) {
- logger.error(e.toString());
- return fail();
- }
-
- }
-
- @GET
- @Produces(MediaType.APPLICATION_JSON)
- public Response getAllFilePathsFromWorker(@PathParam("username") String
username) {
- try {
- return ok(fileManagement.getAllFilePathsFromWorker(username));
- } catch (AdapterException e) {
- logger.error(e.toString());
- return fail();
- }
- }
-
- @DELETE
- @Path("/{filename}")
- public Response deleteFile(String id, @PathParam("filename") String
fileName,
- @PathParam("username") String username) {
- try {
- fileManagement.deleteFileFromWorker(id, fileName, username);
- return ok();
- } catch (AdapterException e) {
- logger.error(e.toString());
- return fail();
- }
- }
-
-
-}
diff --git
a/streampipes-connect-container-worker/src/main/java/org/apache/streampipes/connect/container/worker/init/AdapterWorkerContainerResourceConfig.java
b/streampipes-connect-container-worker/src/main/java/org/apache/streampipes/connect/container/worker/init/AdapterWorkerContainerResourceConfig.java
index f762a4f..a85943e 100644
---
a/streampipes-connect-container-worker/src/main/java/org/apache/streampipes/connect/container/worker/init/AdapterWorkerContainerResourceConfig.java
+++
b/streampipes-connect-container-worker/src/main/java/org/apache/streampipes/connect/container/worker/init/AdapterWorkerContainerResourceConfig.java
@@ -16,17 +16,11 @@
*/
package org.apache.streampipes.connect.container.worker.init;
+import org.apache.streampipes.connect.container.worker.rest.*;
+import org.apache.streampipes.connect.init.AdapterContainerConfig;
import
org.apache.streampipes.rest.shared.serializer.JacksonSerializationProvider;
import org.glassfish.jersey.media.multipart.MultiPartFeature;
import org.springframework.stereotype.Component;
-import org.apache.streampipes.connect.container.worker.rest.FileResource;
-import org.apache.streampipes.connect.container.worker.rest.GuessResource;
-import
org.apache.streampipes.connect.container.worker.rest.RuntimeResolvableResource;
-import org.apache.streampipes.connect.container.worker.rest.WelcomePageWorker;
-import org.apache.streampipes.connect.container.worker.rest.WorkerResource;
-import org.apache.streampipes.connect.init.AdapterContainerConfig;
-import org.apache.streampipes.connect.container.worker.rest.AdapterResource;
-import org.apache.streampipes.connect.container.worker.rest.ProtocolResource;
@Component
public class AdapterWorkerContainerResourceConfig extends
AdapterContainerConfig {
@@ -37,7 +31,6 @@ public class AdapterWorkerContainerResourceConfig extends
AdapterContainerConfig
register(GuessResource.class);
register(RuntimeResolvableResource.class);
register(WorkerResource.class);
- register(FileResource.class);
register(MultiPartFeature.class);
register(AdapterResource.class);
register(ProtocolResource.class);
diff --git
a/streampipes-connect-container-worker/src/main/java/org/apache/streampipes/connect/container/worker/management/FileManagement.java
b/streampipes-connect-container-worker/src/main/java/org/apache/streampipes/connect/container/worker/management/FileManagement.java
deleted file mode 100644
index 04da07f..0000000
---
a/streampipes-connect-container-worker/src/main/java/org/apache/streampipes/connect/container/worker/management/FileManagement.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.streampipes.connect.container.worker.management;
-
-import org.apache.commons.io.IOUtils;
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.List;
-
-public class FileManagement {
-
- public String saveFile(InputStream inputStream, String fileName) throws
IOException {
- fileName = fileName.replaceAll("\\s+", "-");
- String filePath = getMainFilePath() + fileName;
- saveFile(filePath, inputStream);
- return filePath;
- }
-
- public List<String> getFilePaths() {
- List<String> urls = new ArrayList<>();
- File[] files = new File(getMainFilePath()).listFiles();
- if (files != null) {
- for (int i = 0; i < files.length; i++) {
- urls.add(getMainFilePath() + files[i].getName());
- }
- }
-
- return urls;
- }
-
- public File getFile(String name) throws IOException {
- File file = new File(getMainFilePath() + name);
- if(file.exists()) {
- return file;
- } else {
- throw new IOException();
- }
- }
-
- public void deleteFile(String name) throws IOException {
- File file = new File(getMainFilePath() + name);
- if(file.exists()) {
- file.delete();
- } else {
- throw new IOException("File" + name + "is not existing");
- }
- }
-
- private void saveFile(String filePath, InputStream inputStream) throws
IOException {
- File file = new File(filePath);
- file.getParentFile().mkdirs();
- file.createNewFile();
- byte[] aByte = IOUtils.toByteArray(inputStream);
- FileOutputStream fos = new FileOutputStream(file);
- IOUtils.write(aByte, fos);
- }
-
- private String getMainFilePath() {
- String dataLocation = System.getenv("SP_DATA_LOCATION");
- if (dataLocation == null) {
- dataLocation = "/data/";
- }
- return dataLocation;
- }
-
-
-
-
-}
diff --git
a/streampipes-connect-container-worker/src/main/java/org/apache/streampipes/connect/container/worker/rest/FileResource.java
b/streampipes-connect-container-worker/src/main/java/org/apache/streampipes/connect/container/worker/rest/FileResource.java
deleted file mode 100644
index 2671ad6..0000000
---
a/streampipes-connect-container-worker/src/main/java/org/apache/streampipes/connect/container/worker/rest/FileResource.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.streampipes.connect.container.worker.rest;
-
-import
org.apache.streampipes.connect.container.worker.management.FileManagement;
-import org.apache.streampipes.connect.rest.AbstractContainerResource;
-import org.apache.streampipes.model.message.Notifications;
-import org.apache.streampipes.rest.shared.annotation.JacksonSerialized;
-import org.glassfish.jersey.media.multipart.FormDataContentDisposition;
-import org.glassfish.jersey.media.multipart.FormDataParam;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.ws.rs.*;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-
-@Path("/api/v1/{username}/worker/file")
-public class FileResource extends AbstractContainerResource {
-
- private Logger logger = LoggerFactory.getLogger(FileResource.class);
-
- FileManagement fileManagement;
-
- public FileResource() {
- this.fileManagement = new FileManagement();
- }
-
- public FileResource(FileManagement fileManagement) {
- this.fileManagement = fileManagement;
- }
-
- @POST
- @Consumes(MediaType.MULTIPART_FORM_DATA)
- @Produces(MediaType.APPLICATION_JSON)
- public Response uploadFiles(@FormDataParam("file_upload") InputStream
uploadedInputStream,
- @FormDataParam("file_upload") FormDataContentDisposition fileDetail) {
-
- try {
- String filePath = fileManagement.saveFile(uploadedInputStream,
fileDetail.getFileName());
- return ok(Notifications.success(filePath));
- } catch (Exception e) {
- logger.error(e.toString());
- return fail();
- }
- }
-
-
- @GET
- @Path("/{filename}")
- public Response getFile(@PathParam("filename") String fileName) {
- try {
- File file = fileManagement.getFile(fileName);
- logger.info("Downloaded file: " + fileName);
- return Response.ok(file, MediaType.APPLICATION_OCTET_STREAM)
- .header("Content-Disposition", "attachment; filename=\"" +
fileName + "\"")
- .build();
- } catch (IOException e) {
- logger.error(e.toString());
- return fail();
- }
- }
-
- @GET
- @Produces(MediaType.APPLICATION_JSON)
- @JacksonSerialized
- public Response getFilePaths(@PathParam("username") String username) {
- return ok(fileManagement.getFilePaths());
- }
-
-
- @DELETE
- @Path("/{filename}")
- @Consumes(MediaType.APPLICATION_JSON)
- public Response deleteFile(@PathParam("filename") String fileName) {
- try {
- fileManagement.deleteFile(fileName);
- return ok();
- } catch (IOException e) {
- logger.error(e.toString());
- return fail();
- }
- }
-
-}
diff --git
a/ui/src/app/connect/components/data-marketplace/data-marketplace.component.html
b/ui/src/app/connect/components/data-marketplace/data-marketplace.component.html
index 0548d92..3c00d77 100644
---
a/ui/src/app/connect/components/data-marketplace/data-marketplace.component.html
+++
b/ui/src/app/connect/components/data-marketplace/data-marketplace.component.html
@@ -22,9 +22,7 @@
<mat-tab-group [selectedIndex]="selectedIndex"
(selectedIndexChange)="selectedIndexChange($event)">
<mat-tab label="Data Marketplace">
</mat-tab>
- <mat-tab id="all-adapters" label="All Adapters">
- </mat-tab>
- <mat-tab id="uploaded-files" label="Files">
+ <mat-tab id="all-adapters" label="Running Adapters">
</mat-tab>
</mat-tab-group>
</div>
@@ -99,10 +97,5 @@
(updateAdapterEmitter)="updateDescriptionsAndRunningAdatpers()"></sp-adapter-description>
</div>
</div>
- <div *ngIf="selectedIndex === 2">
- <div fxLayout="row wrap" fxLayoutAlign="start stretch"
class="adapter-container">
- <sp-file-management fxFlex="100"
fxLayout="column"></sp-file-management>
- </div>
- </div>
</div>
</div>
\ No newline at end of file
diff --git
a/ui/src/app/connect/components/file-management/file-management.component.css
b/ui/src/app/connect/components/file-management/file-management.component.css
deleted file mode 100644
index 58ba04b..0000000
---
a/ui/src/app/connect/components/file-management/file-management.component.css
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
- *
- */
-
diff --git
a/ui/src/app/connect/components/file-management/file-management.component.html
b/ui/src/app/connect/components/file-management/file-management.component.html
deleted file mode 100644
index ca474d7..0000000
---
a/ui/src/app/connect/components/file-management/file-management.component.html
+++ /dev/null
@@ -1,43 +0,0 @@
-
-<!--
- ~ Licensed to the Apache Software Foundation (ASF) under one or more
- ~ contributor license agreements. See the NOTICE file distributed with
- ~ this work for additional information regarding copyright ownership.
- ~ The ASF licenses this file to You 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.
- ~
- -->
-
-<div fxFlex="100" fxLayout="column" style="margin: 0px; min-height: calc(100vh
- 135px);">
- <div class="assemblyOptions sp-blue-bg">
- <h4>Uploaded Files</h4>
- </div>
- <div class="sp-blue-border">
- <mat-list style="max-height: 300px; overflow-y: scroll" style="margin-top:
-25px;">
- <mat-list-item *ngFor="let url of urls" style="width: 100%">
-
- <div mat-line>
- <button mat-icon-button matTooltip="Copy File Path"
(click)="copyText(url.url)">
- <mat-icon>file_copy</mat-icon>
- </button>
- <label style="font-weight: normal; padding-top: 8px;">
- {{url.name}}
- </label>
- </div>
- <button mat-icon-button (click)="delete(url.name)">
- <mat-icon>delete</mat-icon>
- </button>
- </mat-list-item>
- </mat-list>
- </div>
-
-</div>
diff --git
a/ui/src/app/connect/components/file-management/file-management.component.ts
b/ui/src/app/connect/components/file-management/file-management.component.ts
deleted file mode 100644
index 8315740..0000000
--- a/ui/src/app/connect/components/file-management/file-management.component.ts
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
- *
- */
-
-import {Component, OnInit} from '@angular/core';
-import {FileRestService} from '../../services/filerest.service';
-import {MatSnackBar} from '@angular/material/snack-bar';
-
-@Component({
- selector: 'sp-file-management',
- templateUrl: './file-management.component.html',
- styleUrls: ['./file-management.component.css']
-})
-export class FileManagementComponent implements OnInit {
-
- selectedUploadFile: File;
- fileName;
-
- urls;
-
- constructor(
- private restService: FileRestService,
- public snackBar: MatSnackBar,) { }
-
- ngOnInit() {
- this.getURLS();
- }
-
- getURLS() {
- this.restService.getURLS().subscribe(
- result => {
- this.urls = result;
- },
- error => {
- this.openSnackBar('Error while getting uploaded files', 'Ok');
- },
- );
-
- }
-
- delete(name: string) {
- // TODO: AppId
- this.restService.deleteFile('', name).subscribe(
- result => {
- this.openSnackBar('Deleted successful', 'Ok');
- this.getURLS();
- },
- error => {
- this.openSnackBar('Error while deleting file', 'Ok');
- },
- );
- }
-
-
- openSnackBar(message: string, action: string) {
- this.snackBar.open(message, action, {
- duration: 5000,
- horizontalPosition: 'right',
- verticalPosition: 'top'
- });
- }
-
- copyText(val: string){
- let selBox = document.createElement('textarea');
- selBox.style.position = 'fixed';
- selBox.style.left = '0';
- selBox.style.top = '0';
- selBox.style.opacity = '0';
- selBox.value = val;
- document.body.appendChild(selBox);
- selBox.focus();
- selBox.select();
- document.execCommand('copy');
- document.body.removeChild(selBox);
- this.openSnackBar('Copied URL to Clipboard', 'Ok');
- }
-
-
-
-}
diff --git a/ui/src/app/connect/connect.module.ts
b/ui/src/app/connect/connect.module.ts
index 853b263..650654a 100644
--- a/ui/src/app/connect/connect.module.ts
+++ b/ui/src/app/connect/connect.module.ts
@@ -23,7 +23,6 @@ import {FormsModule, ReactiveFormsModule} from
'@angular/forms';
import {MatFormFieldModule} from '@angular/material/form-field';
import {MatGridListModule} from '@angular/material/grid-list';
import {MatProgressSpinnerModule} from '@angular/material/progress-spinner';
-import {BrowserModule} from '@angular/platform-browser';
import {ConnectComponent} from './connect.component';
import {NewAdapterComponent} from
'./components/new-adapter/new-adapter.component';
@@ -47,8 +46,6 @@ import {ConnectService} from './services/connect.service';
import {AdapterDescriptionComponent} from
'./components/data-marketplace/adapter-description/adapter-description.component';
import {DataMarketplaceComponent} from
'./components/data-marketplace/data-marketplace.component';
import {DataMarketplaceService} from './services/data-marketplace.service';
-import {FileManagementComponent} from
'./components/file-management/file-management.component';
-import {FileRestService} from './services/filerest.service';
import {FormatComponent} from './components/format-component/format.component';
import {FormatListComponent} from
'./components/format-list-component/format-list.component';
import {IconService} from './services/icon.service';
@@ -56,7 +53,6 @@ import {UnitProviderService} from
'./services/unit-provider.service';
import {FilterPipe} from './filter/filter.pipe';
-import {PlatformServicesModule} from '../platform-services/platform.module';
import {AdapterExportDialog} from
'./dialog/adapter-export/adapter-export-dialog.component';
import {AdapterUploadDialog} from
'./dialog/adapter-upload/adapter-upload-dialog.component';
import {EditEventPropertyListComponent} from
'./dialog/edit-event-property/components/edit-event-property-list/edit-event-property-list.component';
@@ -65,7 +61,6 @@ import {MatChipsModule} from '@angular/material/chips';
import {MatSliderModule} from '@angular/material/slider';
import {TreeModule} from 'angular-tree-component';
import {xsService} from '../NS/XS.service';
-import {PropertySelectorService} from '../services/property-selector.service';
import {EditDataTypeComponent} from
'./dialog/edit-event-property/components/edit-data-type/edit-data-type.component';
import {EditTimestampPropertyComponent} from
'./dialog/edit-event-property/components/edit-timestamp-property/edit-timestamp-property.component';
import {EditUnitTransformationComponent} from
'./dialog/edit-event-property/components/edit-unit-transformation/edit-unit-transformation.component';
@@ -73,7 +68,6 @@ import {EditEventPropertyComponent} from
'./dialog/edit-event-property/edit-even
import {PipelineElementRuntimeInfoComponent} from
'./components/runtime-info/pipeline-element-runtime-info.component';
import {EventPropertyRowComponent} from
'./components/schema-editor/event-property-row/event-property-row.component';
import {EventSchemaPreviewComponent} from
'./components/schema-editor/event-schema-preview/event-schema-preview.component';
-import {TourProviderService} from "../services/tour/tour-provider.service";
import {CoreUiModule} from "../core-ui/core-ui.module";
@NgModule({
@@ -112,7 +106,6 @@ import {CoreUiModule} from "../core-ui/core-ui.module";
EditTimestampPropertyComponent,
EditDataTypeComponent,
EventSchemaPreviewComponent,
- FileManagementComponent,
FilterPipe,
FormatComponent,
FormatFormComponent,
@@ -131,7 +124,6 @@ import {CoreUiModule} from "../core-ui/core-ui.module";
IconService,
UnitProviderService,
TimestampPipe,
- FileRestService,
xsService,
],
entryComponents: [ConnectComponent, AdapterStartedDialog,
AdapterExportDialog, AdapterUploadDialog, EditEventPropertyComponent],
diff --git a/ui/src/app/connect/services/filerest.service.ts
b/ui/src/app/connect/services/filerest.service.ts
deleted file mode 100644
index fbb799a..0000000
--- a/ui/src/app/connect/services/filerest.service.ts
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
- *
- */
-
-import {Injectable} from '@angular/core';
-import {Observable} from 'rxjs';
-import {map} from 'rxjs/operators';
-import {HttpClient, HttpRequest} from '@angular/common/http';
-import {AuthStatusService} from '../../services/auth-status.service';
-
-
-@Injectable()
-export class FileRestService {
-
-
- constructor(
- private http: HttpClient,
- private authStatusService: AuthStatusService
- ) {
- }
-
- private get baseUrl() {
- return '/streampipes-connect';
- }
-
- private get url() {
- // TODO
- return this.baseUrl + '/api/v1/' + this.authStatusService.email +
'/master/file'
- }
-
- /**
- * @deprecated use deleteFile
- */
- delete(id: string) {
- return this.http.delete(this.url + '/' + id);
- }
-
- deleteFile(adapterId: string, id: string) {
- const req = new HttpRequest('DELETE', this.url + '/' + id, adapterId);
- return this.http.request(req);
- }
-
-
-
- getURLS(): Observable<any> {
- return this.http.get(this.url)
- .pipe(map(res => {
- let result = [];
- let stringArray = res as String[];
- stringArray.forEach(url => {
- let splitted = url.split("/");
- let fileName = splitted[splitted.length - 1];
- result.push({"name": fileName, "url": url})
- });
- return result;
- }));
- }
-
-
-}