Exemple #1
0
def delete(service):
    """Delete a file."""
    filesystem = _build_filesystem(service)
    if filesystem.isdir(request.args.get('path')):
        filesystem.removedir(request.args.get('path'))
    else:
        filesystem.remove(request.args.get('path'))
    return redirect(url_for('cloudutils.view', service=service))
Exemple #2
0
def delete(service):
    """Delete a file."""
    filesystem = _build_filesystem(service)
    if filesystem.isdir(request.args.get('path')):
        filesystem.removedir(request.args.get('path'))
    else:
        filesystem.remove(request.args.get('path'))
    return redirect(url_for('cloudutils.view', service=service))
Exemple #3
0
def view(service):
    """View page."""
    try:
        filesystem = _build_filesystem(service)
    except Exception as e:
        current_app.logger.exception(e)
        raise

    return _build_page(filesystem, service)
Exemple #4
0
def view(service):
    """View page."""
    try:
        filesystem = _build_filesystem(service)
    except Exception as e:
        current_app.logger.exception(e)
        raise

    return _build_page(filesystem, service)
Exemple #5
0
def download(service):
    """Download a file."""
    filesystem = _build_filesystem(service)

    if filesystem.haspathurl(request.args.get('path')):
        url = filesystem.getpathurl(request.args.get('path'))
        return redirect(url)
    else:
        return make_response(filesystem.open(
            request.args.get('path'), 'rb').read())
Exemple #6
0
def download(service):
    """Download a file."""
    filesystem = _build_filesystem(service)

    if filesystem.haspathurl(request.args.get('path')):
        url = filesystem.getpathurl(request.args.get('path'))
        return redirect(url)
    else:
        return make_response(
            filesystem.open(request.args.get('path'), 'rb').read())
Exemple #7
0
def callback(service):
    """Check that we can build a filesystem from the given service."""
    _build_filesystem(service)
    return redirect(url_for('cloudutils.view', service=service))
Exemple #8
0
def callback(service):
    """Check that we can build a filesystem from the given service."""
    _build_filesystem(service)
    return redirect(url_for('cloudutils.view', service=service))