} else {
requestCallback = new RequestCallback() {
@Override
public void onError( Request request, Throwable th ) {
WaitPopup.getInstance().setVisible( false );
MessageDialogBox dialogBox =
new MessageDialogBox( Messages.getString( "error" ), th.toString(), false, false, true ); //$NON-NLS-1$
dialogBox.center();
}
@Override
public void onResponseReceived( Request arg0, Response arg1 ) {
WaitPopup.getInstance().setVisible( false );
if ( arg1.getStatusCode() == Response.SC_OK ) {
dirty = false;
// Refresh current folder or parent folder
PerspectiveManager.getInstance().setPerspective( PerspectiveManager.BROWSER_PERSPECTIVE );
GenericEvent ge = new GenericEvent();
if ( fileName == null ) { // Filename is null, then it is a folder
ge.setEventSubType( "RefreshFolderEvent" );
ge.setStringParam( parentPath );
} else {
ge.setEventSubType( "RefreshFileEvent" );
JSONObject strParam = new JSONObject();
strParam.put( "path", new JSONString( parentPath ) );
strParam.put( "fileName", new JSONString( fileName ) );
ge.setStringParam( strParam.toString() );
}
EventBusUtil.EVENT_BUS.fireEvent( ge );
} else {
MessageDialogBox dialogBox =
new MessageDialogBox(
Messages.getString( "error" ), Messages.getString( "operationPermissionDenied" ), false, false, true ); //$NON-NLS-1$
dialogBox.center();
}
}
};
}
requestBuilder.setCallback( requestCallback );