mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-28 14:04:43 -04:00
Merge pull request #964 from hedgedoc/mediaBackend/removeGetFileUrl
This commit is contained in:
commit
b93cf3ef2f
2 changed files with 1 additions and 15 deletions
|
@ -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 {
|
private getFilePath(fileName: string): string {
|
||||||
return join(this.uploadDirectory, fileName);
|
return join(this.uploadDirectory, fileName);
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,18 +17,10 @@ export interface MediaBackend {
|
||||||
saveFile(buffer: Buffer, fileName: string): Promise<[string, BackendData]>;
|
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 fileName String to identify the file
|
||||||
* @param backendData Internal backend data
|
* @param backendData Internal backend data
|
||||||
* @throws {MediaBackendError} - there was an error deleting the file
|
* @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>;
|
deleteFile(fileName: string, backendData: BackendData): Promise<void>;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue