mirror of
https://github.com/nextcloud/documentation.git
synced 2026-01-03 02:09:45 +07:00
Fix sample code format
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
This commit is contained in:
@@ -80,14 +80,14 @@ Code example
|
||||
|
||||
private void startFolderCreation(String newFolderPath) {
|
||||
CreateRemoteFolderOperation createOperation = new CreateRemoteFolderOperation(newFolderPath, false);
|
||||
createOperation.execute( mClient , this , mHandler);
|
||||
createOperation.execute(mClient, this, mHandler);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRemoteOperationFinish(RemoteOperation operation, RemoteOperationResult result) {
|
||||
if (operation instanceof CreateRemoteFolderOperation) {
|
||||
if (result.isSuccess()) {
|
||||
// do your stuff here
|
||||
// do your stuff here
|
||||
}
|
||||
}
|
||||
…
|
||||
@@ -107,7 +107,7 @@ Code example
|
||||
.. code-block:: java
|
||||
|
||||
private void startReadRootFolder() {
|
||||
ReadRemoteFolderOperation refreshOperation = new ReadRemoteFolderOperation(FileUtils.PATH_SEPARATOR);
|
||||
ReadRemoteFolderOperation refreshOperation = new ReadRemoteFolderOperation(FileUtils.PATH_SEPARATOR);
|
||||
// root folder
|
||||
refreshOperation.execute(mClient, this, mHandler);
|
||||
}
|
||||
@@ -164,7 +164,7 @@ Code example
|
||||
|
||||
private void startRemoveFile(String filePath) {
|
||||
RemoveRemoteFileOperation removeOperation = new RemoveRemoteFileOperation(remotePath);
|
||||
removeOperation.execute( mClient , this , mHandler);
|
||||
removeOperation.execute(mClient, this, mHandler);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -197,7 +197,7 @@ Code example
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRemoteOperationFinish( RemoteOperation operation, RemoteOperationResult result) {
|
||||
public void onRemoteOperationFinish(RemoteOperation operation, RemoteOperationResult result) {
|
||||
if (operation instanceof DownloadRemoteFileOperation) {
|
||||
if (result.isSuccess()) {
|
||||
// do your stuff here
|
||||
@@ -206,7 +206,7 @@ Code example
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTransferProgress( long progressRate, long totalTransferredSoFar, long totalToTransfer, String fileName) {
|
||||
public void onTransferProgress(long progressRate, long totalTransferredSoFar, long totalToTransfer, String fileName) {
|
||||
mHandler.post( new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
@@ -227,8 +227,8 @@ Code example
|
||||
|
||||
.. code-block:: java
|
||||
|
||||
private void startUpload (File fileToUpload, String remotePath, String mimeType) {
|
||||
UploadRemoteFileOperation uploadOperation = new UploadRemoteFileOperation( fileToUpload.getAbsolutePath(), remotePath, mimeType);
|
||||
private void startUpload(File fileToUpload, String remotePath, String mimeType) {
|
||||
UploadRemoteFileOperation uploadOperation = new UploadRemoteFileOperation(fileToUpload.getAbsolutePath(), remotePath, mimeType);
|
||||
uploadOperation.addDatatransferProgressListener(this);
|
||||
uploadOperation.execute(mClient, this, mHandler);
|
||||
}
|
||||
@@ -244,7 +244,7 @@ Code example
|
||||
|
||||
@Override
|
||||
public void onTransferProgress(long progressRate, long totalTransferredSoFar, long totalToTransfer, String fileName) {
|
||||
mHandler.post( new Runnable() {
|
||||
mHandler.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
// do your UI updates about progress here
|
||||
@@ -269,14 +269,14 @@ Code example
|
||||
|
||||
private void startFileMove(String filePath, String newFilePath, boolean overwrite) {
|
||||
MoveRemoteFileOperation moveOperation = new MoveRemoteFileOperation(filePath, newFilePath, overwrite);
|
||||
moveOperation.execute( mClient , this , mHandler);
|
||||
moveOperation.execute(mClient, this, mHandler);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRemoteOperationFinish(RemoteOperation operation, RemoteOperationResult result) {
|
||||
if (operation instanceof MoveRemoteFileOperation) {
|
||||
if (result.isSuccess()) {
|
||||
// do your stuff here
|
||||
// do your stuff here
|
||||
}
|
||||
}
|
||||
…
|
||||
@@ -295,16 +295,16 @@ Code example
|
||||
|
||||
private void startAllSharesRetrieval() {
|
||||
GetRemoteSharesOperation getSharesOp = new GetRemoteSharesOperation();
|
||||
getSharesOp.execute( mClient , this , mHandler);
|
||||
getSharesOp.execute(mClient, this, mHandler);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRemoteOperationFinish( RemoteOperation operation, RemoteOperationResult result) {
|
||||
public void onRemoteOperationFinish(RemoteOperation operation, RemoteOperationResult result) {
|
||||
if (operation instanceof GetRemoteSharesOperation) {
|
||||
if (result.isSuccess()) {
|
||||
ArrayList< OCShare > shares = new ArrayList< OCShare >();
|
||||
for (Object obj: result.getData()) {
|
||||
shares.add(( OCShare) obj);
|
||||
shares.add((OCShare) obj);
|
||||
}
|
||||
// do your stuff here
|
||||
}
|
||||
@@ -327,21 +327,21 @@ Code example
|
||||
|
||||
private void startSharesRetrievalForFileOrFolder(String filePath, boolean getReshares) {
|
||||
GeteRemoteSharesForFileOperation operation = new GetRemoteSharesForFileOperation(filePath, getReshares, false);
|
||||
operation.execute( mClient, this, mHandler);
|
||||
operation.execute(mClient, this, mHandler);
|
||||
}
|
||||
|
||||
private void startSharesRetrievalForFilesInFolder(String folderPath, boolean getReshares) {
|
||||
GetRemoteSharesForFileOperation operation = new GetRemoteSharesForFileOperation(folderPath, getReshares, true);
|
||||
operation.execute( mClient, this, mHandler);
|
||||
operation.execute(mClient, this, mHandler);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRemoteOperationFinish( RemoteOperation operation, RemoteOperationResult result) {
|
||||
public void onRemoteOperationFinish(RemoteOperation operation, RemoteOperationResult result) {
|
||||
if (operation instanceof GetRemoteSharesForFileOperation) {
|
||||
if (result.isSuccess()) {
|
||||
ArrayList< OCShare > shares = new ArrayList< OCShare >();
|
||||
for (Object obj: result.getData()) {
|
||||
shares.add(( OCShare) obj);
|
||||
shares.add((OCShare) obj);
|
||||
}
|
||||
// do your stuff here
|
||||
}
|
||||
@@ -367,7 +367,7 @@ Code example
|
||||
|
||||
private void startCreationOfPublicShareForFile(String filePath, String password) {
|
||||
CreateRemoteShareOperation operation = new CreateRemoteShareOperation(filePath, ShareType.PUBLIC_LINK, "", false, password, 1);
|
||||
operation.execute( mClient , this , mHandler);
|
||||
operation.execute(mClient, this, mHandler);
|
||||
}
|
||||
|
||||
private void startCreationOfGroupShareForFile(String filePath, String groupId) {
|
||||
@@ -381,10 +381,10 @@ Code example
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRemoteOperationFinish( RemoteOperation operation, RemoteOperationResult result) {
|
||||
public void onRemoteOperationFinish(RemoteOperation operation, RemoteOperationResult result) {
|
||||
if (operation instanceof CreateRemoteShareOperation) {
|
||||
if (result.isSuccess()) {
|
||||
OCShare share = (OCShare) result.getData ().get(0);
|
||||
OCShare share = (OCShare) result.getData().get(0);
|
||||
// do your stuff here
|
||||
}
|
||||
}
|
||||
@@ -405,14 +405,14 @@ Code example
|
||||
|
||||
private void startShareRemoval(OCShare share) {
|
||||
RemoveRemoteShareOperation operation = new RemoveRemoteShareOperation((int) share.getIdRemoteShared());
|
||||
operation.execute( mClient, this, mHandler);
|
||||
operation.execute(mClient, this, mHandler);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRemoteOperationFinish( RemoteOperation operation, RemoteOperationResult result) {
|
||||
public void onRemoteOperationFinish(RemoteOperation operation, RemoteOperationResult result) {
|
||||
if (operation instanceof RemoveRemoteShareOperation) {
|
||||
if (result.isSuccess()) {
|
||||
// do your stuff here
|
||||
// do your stuff here
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1045,7 +1045,7 @@ The template file **ownnotes/templates/part.navigation.php** contains the naviga
|
||||
<script id="navigation-tpl" type="text/x-handlebars-template">
|
||||
<li id="new-note"><a href="#"><?php p($l->t('Add note')); ?></a></li>
|
||||
{{#each notes}}
|
||||
<li class="note with-menu {{#if active}}active{{/if}}" data-id="{{ id }}">
|
||||
<li class="note with-menu {{#if active}}active{{/if}}" data-id="{{ id }}">
|
||||
<a href="#">{{ title }}</a>
|
||||
<div class="app-navigation-entry-utils">
|
||||
<ul>
|
||||
|
||||
Reference in New Issue
Block a user