Skip to content

Commit 0436d87

Browse files
committed
Merge pull request #33 from camilolopes/master
release 1.2.0 version
2 parents 33cf396 + 7f9b6d3 commit 0436d87

File tree

3 files changed

+32
-2
lines changed

3 files changed

+32
-2
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
22
<modelVersion>4.0.0</modelVersion>
33
<artifactId>easyJavaDropboxAPI</artifactId>
4-
<version>1.1.0</version>
4+
<version>1.2.0</version>
55
<build>
66
<sourceDirectory>src</sourceDirectory>
77
<plugins>

src/com/its/easyjavadropbox/api/impl/EasyJavaDropBoxServiceImpl.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,4 +87,17 @@ public void saveToDropbox(String finalName, InputStream inputStreamContent) thro
8787
client.uploadFile(finalNamePathFull, DbxWriteMode.add(), numBytesUndefined, inputStreamContent);
8888

8989
}
90+
@Override
91+
public void renameFileRoot(String currentNameFile, String newNameFile) throws DbxException {
92+
String currentPathFile = root + currentNameFile ;
93+
String newFile = root + newNameFile;
94+
client.move(currentPathFile, newFile);
95+
96+
}
97+
@Override
98+
public void renameFile(String pathFolder, String currentPathFile, String newNameFile) throws DbxException {
99+
String fullCurrentPath = pathFolder + currentPathFile;
100+
newNameFile = pathFolder + newNameFile;
101+
client.move(fullCurrentPath, newNameFile);
102+
}
90103
}

src/com/its/easyjavadropbox/api/interfaces/EasyJavaDropBoxService.java

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public interface EasyJavaDropBoxService {
4949
* @param ident inform xs, s, m ,l , xl
5050
* @param fileName
5151
* @param width
52-
* @param height
52+
* @param height;
5353
* @param outputStream
5454
* @throws IOException
5555
* @throws DbxException
@@ -65,5 +65,22 @@ public interface EasyJavaDropBoxService {
6565
* @throws IOException
6666
*/
6767
public void saveToDropbox(String finalName,InputStream inputStreamContent) throws DbxException,IOException;
68+
69+
/**
70+
* Use this method only if the file is located in root "/" of your app
71+
* @param currentNameFile inform name of file that will be renamed e.g:file.txt
72+
* @param newNameFile inform new name of file e.g: myfile.txt
73+
* @throws DbxException is thrown if file is not found error 404
74+
*/
75+
public void renameFileRoot(String currentNameFile, String newNameFile) throws DbxException;
76+
77+
/**
78+
*
79+
* @param pathFolder inform the folder where the file is located e.g: /myfolder/
80+
* @param currentNameFile inform the name of file that will be renamed
81+
* @param newNameFile the name that will be renamed e.g: photous.png
82+
* @throws DbxException if the file is not found in the path informed exception is thrown.
83+
*/
84+
public void renameFile(String pathFolder, String currentNameFile, String newNameFile) throws DbxException;
6885

6986
}

0 commit comments

Comments
 (0)