Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
public class DeleteSkipTrashParam extends BooleanParam {

public static final String NAME = "skiptrash";
public static final String DEFAULT = FALSE;
public static final String DEFAULT = TRUE;

private static final Domain DOMAIN = new Domain(NAME);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ public static class DeleteSkipTrashParam extends BooleanParam {
* Constructor.
*/
public DeleteSkipTrashParam() {
super(NAME, false);
super(NAME, true);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -841,7 +841,7 @@ public void testCreateDelete() throws Exception {
fs.mkdirs(new Path(dir2));

createWithHttp(path2, null);
deleteWithHttp(path2, null, null, true);
deleteWithHttp(path2, null, null, false);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,33 +165,12 @@ <h4 class="modal-title" id="delete-modal-title">Delete</h4>
<div class="modal-footer">
<button type="button" class="btn" data-dismiss="modal">Cancel</button>
<button type="button" class="btn btn-success" id="delete-button"
data-complete-text="Deleting..." data-toggle="modal" data-target="#delete-trash-modal">Delete
</button>
data-complete-text="Deleting...">Delete</button>
</div>
</div>
</div>
</div>
<div class="modal" id="delete-trash-modal" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"
aria-hidden="true">&times;</button>
<h4 class="modal-title" id="delete-trash-modal-title">Delete Trash</h4>
</div>
<div class="modal-body">
<div class="panel-body">
<div id="delete-trash-prompt"></div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn" id="skip-trash-button">Yes (Skip Trash)</button>
<button type="button" class="btn btn-success" id="trash-button">No</button>
</div>
</div>
</div>
</div>

<!-- Delete Trash modal similar to hdfs/explorer.html is absent -->
<div class="row">
<div class="col-xs-9 col-md-9">
<form onsubmit="return false;">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,46 +83,23 @@
$('#delete-modal-title').text("Delete - " + inode_name);
$('#delete-prompt').text("Are you sure you want to delete " + inode_name
+ " ?");
$('#delete-trash-modal-title').text("Skip Trash - " + inode_name);
$('#delete-trash-prompt').text("Skipping Trash might delete file forever."
+ " Do you want to skip-trash " + inode_name
+ " ? (default behaviour - No)");
// Delete Trash modal similar to hdfs/explorer.js is absent

$('#skip-trash-button').click(function () {
// DELETE /webhdfs/v1/<path>?op=DELETE&recursive=<true|false>&skiptrash=true
var url = '/webhdfs/v1' + encode_path(absolute_file_path) +
'?op=DELETE' + '&recursive=true&skiptrash=true';
$.ajax(url,
{
type: 'DELETE'
}).done(function (data) {
browse_directory(current_directory);
}).fail(network_error_handler(url)
).always(function () {
$('#delete-modal').modal('hide');
$('#delete-button').button('reset');
$('#delete-trash-modal').modal('hide');
$('#skip-trash-button').button('reset');
});
})
$('#trash-button').click(function () {
$('#delete-button').click(function() {
// DELETE /webhdfs/v1/<path>?op=DELETE&recursive=<true|false>
var url = '/webhdfs/v1' + encode_path(absolute_file_path) +
'?op=DELETE' + '&recursive=true';

$.ajax(url,
{
type: 'DELETE'
}).done(function (data) {
{ type: 'DELETE'
}).done(function(data) {
browse_directory(current_directory);
}).fail(network_error_handler(url)
).always(function () {
).always(function() {
$('#delete-modal').modal('hide');
$('#delete-button').button('reset');
$('#delete-trash-modal').modal('hide');
$('#trash-button').button('reset');
});
})

$('#delete-modal').modal();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,12 @@
$('#delete-trash-modal-title').text("Skip Trash - " + inode_name);
$('#delete-trash-prompt').text("Skipping Trash might delete file forever."
+ " Do you want to skip-trash " + inode_name
+ " ? (default behaviour - No)");
+ " ? Note: File can be moved to Trash only if trash interval is configured.");

$('#skip-trash-button').click(function () {
// DELETE /webhdfs/v1/<path>?op=DELETE&recursive=<true|false>&skiptrash=true
// DELETE /webhdfs/v1/<path>?op=DELETE&recursive=<true|false>
var url = '/webhdfs/v1' + encode_path(absolute_file_path) +
'?op=DELETE' + '&recursive=true&skiptrash=true';
'?op=DELETE' + '&recursive=true';
$.ajax(url,
{
type: 'DELETE'
Expand All @@ -106,9 +106,9 @@
});
})
$('#trash-button').click(function () {
// DELETE /webhdfs/v1/<path>?op=DELETE&recursive=<true|false>
// DELETE /webhdfs/v1/<path>?op=DELETE&recursive=<true|false>&skiptrash=<true|false>
var url = '/webhdfs/v1' + encode_path(absolute_file_path) +
'?op=DELETE' + '&recursive=true';
'?op=DELETE' + '&recursive=true&skiptrash=false';
$.ajax(url,
{
type: 'DELETE'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ See also: [`destination`](#Destination), [FileSystem](../../api/org/apache/hadoo

Default values of queryparams if not provided:
1. recursive: false
2. skiptrash: false
2. skiptrash: true

The client receives a response with a [`boolean` JSON object](#Boolean_JSON_Schema):

Expand Down