new release

This commit is contained in:
Page Asgardius 2022-12-29 10:54:21 -07:00
parent 44c28dc748
commit d49fb984e0
4 changed files with 28 additions and 13 deletions

View file

@ -9,8 +9,8 @@ android {
applicationId "asgardius.page.s3manager"
minSdk 23
targetSdk 33
versionCode 50
versionName "0.4.4"
versionCode 51
versionName "0.5.0"
setProperty("archivesBaseName", "s3-manager-$versionName")
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
@ -33,19 +33,19 @@ android {
dependencies {
implementation 'androidx.appcompat:appcompat:1.3.0'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
def exoplayer_version = "2.18.1"
implementation 'androidx.appcompat:appcompat:1.5.1'
implementation 'com.google.android.material:material:1.7.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
def exoplayer_version = "2.18.2"
implementation "com.google.android.exoplayer:exoplayer:$exoplayer_version"
implementation "com.google.android.exoplayer:extension-mediasession:$exoplayer_version"
implementation 'androidx.recyclerview:recyclerview:1.2.1'
// BEGIN AWS DEPENDENCIES
def aws_version = "2.58.0"
def aws_version = "2.60.0"
implementation "com.amazonaws:aws-android-sdk-s3:$aws_version"
implementation ("com.amazonaws:aws-android-sdk-mobile-client:$aws_version") { transitive = true }
// END AWS DEPENDENCIES
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
androidTestImplementation 'androidx.test.ext:junit:1.1.4'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.0'
}

View file

@ -9,8 +9,8 @@
<H3>Created by Page Asgardius</H3>
<H3>Libraries used in this app</H3>
<ul>
<li>Amazon Web Services SDK 2.58.0</li>
<li>ExoPlayer 2.18.1</li>
<li>Amazon Web Services SDK 2.60.0</li>
<li>ExoPlayer 2.18.2</li>
<li>Adwaita Icon Theme for GNOME 43</li>
<li>pdf.js</li>
</ul>

View file

@ -41,6 +41,7 @@ public class Downloader extends AppCompatActivity {
String username, password, endpoint, bucket, filename, prefix, location;
Uri fileuri, filepath;
Region region;
String[] folder;
S3ClientOptions s3ClientOptions;
AWSCredentials myCredentials;
AmazonS3 s3client;
@ -128,7 +129,6 @@ public class Downloader extends AppCompatActivity {
//s3client.createBucket(bucket, location);
//System.out.println(fkey);
if (isfolder) {
document = DocumentFile.fromTreeUri(getApplicationContext(), fileuri);
if (prefix == null) {
orequest = new ListObjectsRequest().withBucketName(bucket).withMaxKeys(1000);
} else {
@ -161,8 +161,22 @@ public class Downloader extends AppCompatActivity {
}
for (String os : objectlist) {
document = DocumentFile.fromTreeUri(getApplicationContext(), fileuri);
object = s3client.getObject(bucket, os);
if (os.replace(prefix, "").contains("/")) {
folder = os.replace(prefix, "").split("/");
for (int i = 0; i < folder.length-1; i++) {
DocumentFile subfolder = document.findFile(folder[i].replace("/", ""));
if (subfolder != null) {
document = subfolder;
} else {
document = document.createDirectory(folder[i].replace("/", ""));
}
}
filepath = document.createFile(null, folder[folder.length-1]).getUri();
} else {
filepath = document.createFile(null, os.replace(prefix, "")).getUri();
}
writeContentToFile(filepath, object);
}
} else {

View file

@ -0,0 +1 @@
* Folder download function added