Merge pull request #964 from hedgedoc/mediaBackend/removeGetFileUrl

This commit is contained in:
David Mehren 2021-02-27 13:03:42 +01:00 committed by GitHub
commit b93cf3ef2f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 15 deletions

View file

@ -53,12 +53,6 @@ export class FilesystemBackend implements MediaBackend {
}
}
getFileURL(fileName: string, _: BackendData): Promise<string> {
const filePath = this.getFilePath(fileName);
// TODO: Add server address to url
return Promise.resolve('/' + filePath);
}
private getFilePath(fileName: string): string {
return join(this.uploadDirectory, fileName);
}

View file

@ -17,18 +17,10 @@ export interface MediaBackend {
saveFile(buffer: Buffer, fileName: string): Promise<[string, BackendData]>;
/**
* Retrieve the URL of a previously saved file.
* Delete a file from the backend
* @param fileName String to identify the file
* @param backendData Internal backend data
* @throws {MediaBackendError} - there was an error deleting the file
*/
getFileURL(fileName: string, backendData: BackendData): Promise<string>;
/**
* Delete a file from the backend
* @param fileName String to identify the file
* @param backendData Internal backend data
* @throws {MediaBackendError} - there was an error retrieving the url
*/
deleteFile(fileName: string, backendData: BackendData): Promise<void>;
}