├── .gitignore ├── .idea ├── caches │ └── build_file_checksums.ser ├── codeStyles │ └── Project.xml ├── gradle.xml ├── misc.xml ├── runConfigurations.xml └── vcs.xml ├── README.md ├── app ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── org │ │ └── ipfsbox │ │ └── android_ipfs_api │ │ └── ExampleInstrumentedTest.java │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── org │ │ │ └── ipfsbox │ │ │ └── api │ │ │ └── MainActivity.java │ └── res │ │ ├── drawable-v24 │ │ └── ic_launcher_foreground.xml │ │ ├── drawable │ │ └── ic_launcher_background.xml │ │ ├── layout │ │ └── activity_main.xml │ │ ├── mipmap-anydpi-v26 │ │ ├── ic_launcher.xml │ │ └── ic_launcher_round.xml │ │ ├── mipmap-hdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-mdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ └── values │ │ ├── colors.xml │ │ ├── strings.xml │ │ └── styles.xml │ └── test │ └── java │ └── org │ └── ipfsbox │ └── android_ipfs_api │ └── ExampleUnitTest.java ├── build.gradle ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── library ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── org │ │ └── ipfsbox │ │ └── library │ │ └── ExampleInstrumentedTest.java │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── org │ │ │ └── ipfsbox │ │ │ └── library │ │ │ ├── Bitswap.java │ │ │ ├── Block.java │ │ │ ├── Bootstrap.java │ │ │ ├── Callback.java │ │ │ ├── Config.java │ │ │ ├── Dag.java │ │ │ ├── Dht.java │ │ │ ├── Diag.java │ │ │ ├── File.java │ │ │ ├── FileStore.java │ │ │ ├── Files.java │ │ │ ├── IpfsBox.java │ │ │ ├── Key.java │ │ │ ├── Log.java │ │ │ ├── Name.java │ │ │ ├── Object.java │ │ │ ├── P2p.java │ │ │ ├── Pin.java │ │ │ ├── Pubsub.java │ │ │ ├── Refs.java │ │ │ ├── Repo.java │ │ │ ├── Stats.java │ │ │ ├── Swarm.java │ │ │ ├── Tar.java │ │ │ ├── Util.java │ │ │ ├── entity │ │ │ ├── Add.java │ │ │ ├── Bitswap_stat.java │ │ │ ├── Commands.java │ │ │ ├── Config.java │ │ │ ├── Dag.java │ │ │ ├── Id.java │ │ │ ├── Stats_bw.java │ │ │ ├── Swarm.java │ │ │ └── Version.java │ │ │ └── service │ │ │ └── CommandService.java │ └── res │ │ └── values │ │ └── strings.xml │ └── test │ └── java │ └── org │ └── ipfsbox │ └── library │ └── ExampleUnitTest.java └── settings.gradle /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/libraries 5 | /.idea/modules.xml 6 | /.idea/workspace.xml 7 | .DS_Store 8 | /build 9 | /captures 10 | .externalNativeBuild 11 | -------------------------------------------------------------------------------- /.idea/caches/build_file_checksums.ser: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qs-lll/android-ipfs-api/61a8733b0422d6d8c7e11db6f1bda036b79edf94/.idea/caches/build_file_checksums.ser -------------------------------------------------------------------------------- /.idea/codeStyles/Project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 15 | 16 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 18 | 19 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 17 | 27 | 28 | 29 | 30 | 31 | 32 | 34 | -------------------------------------------------------------------------------- /.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![](https://ipfs.io/ipfs/QmQJ68PFMDdAsgCZvA1UVzzn18asVcf7HVvCDgpjiSCAse) 2 | # android-ipfs-api 3 | A Android implementation of the HTTP IPFS API 4 | 5 | # play ipfs on android 6 | 7 | ## first 8 | download ipfsbox and run local node! 9 | 10 | http://www.ipfsbox.org 11 | ## after node daemon 12 | run demo to join play ipfs 13 | ## contact me 14 | join the Telegram: 15 | 16 | https://t.me/joinchat/HjRVuhJL9AcrSAXvwhBjYw 17 | 18 | wechat: 19 | 20 | 21 | -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 26 5 | defaultConfig { 6 | applicationId "org.ipfsbox.api" 7 | minSdkVersion 15 8 | targetSdkVersion 26 9 | versionCode 1 10 | versionName "1.0" 11 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 12 | } 13 | buildTypes { 14 | release { 15 | minifyEnabled false 16 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 17 | } 18 | } 19 | } 20 | 21 | dependencies { 22 | implementation fileTree(include: ['*.jar'], dir: 'libs') 23 | implementation 'com.android.support:appcompat-v7:26.1.0' 24 | implementation 'com.android.support.constraint:constraint-layout:1.1.0' 25 | testImplementation 'junit:junit:4.12' 26 | androidTestImplementation 'com.android.support.test:runner:1.0.2' 27 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' 28 | implementation project(':library') 29 | } 30 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /app/src/androidTest/java/org/ipfsbox/android_ipfs_api/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package org.ipfsbox.android_ipfs_api; 2 | 3 | import android.content.Context; 4 | import android.support.test.InstrumentationRegistry; 5 | import android.support.test.runner.AndroidJUnit4; 6 | 7 | import org.junit.Test; 8 | import org.junit.runner.RunWith; 9 | 10 | import static org.junit.Assert.*; 11 | 12 | /** 13 | * Instrumented test, which will execute on an Android device. 14 | * 15 | * @see Testing documentation 16 | */ 17 | @RunWith(AndroidJUnit4.class) 18 | public class ExampleInstrumentedTest { 19 | @Test 20 | public void useAppContext() { 21 | // Context of the app under test. 22 | Context appContext = InstrumentationRegistry.getTargetContext(); 23 | 24 | assertEquals("org.ipfsbox.android_ipfs_api", appContext.getPackageName()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /app/src/main/java/org/ipfsbox/api/MainActivity.java: -------------------------------------------------------------------------------- 1 | package org.ipfsbox.api; 2 | 3 | import android.support.v7.app.AppCompatActivity; 4 | import android.os.Bundle; 5 | 6 | import org.ipfsbox.android_ipfs_api.R; 7 | 8 | public class MainActivity extends AppCompatActivity { 9 | 10 | @Override 11 | protected void onCreate(Bundle savedInstanceState) { 12 | super.onCreate(savedInstanceState); 13 | setContentView(R.layout.activity_main); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-v24/ic_launcher_foreground.xml: -------------------------------------------------------------------------------- 1 | 7 | 12 | 13 | 19 | 22 | 25 | 26 | 27 | 28 | 34 | 35 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_launcher_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 10 | 15 | 20 | 25 | 30 | 35 | 40 | 45 | 50 | 55 | 60 | 65 | 70 | 75 | 80 | 85 | 90 | 95 | 100 | 105 | 110 | 115 | 120 | 125 | 130 | 135 | 140 | 145 | 150 | 155 | 160 | 165 | 170 | 171 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 17 | 18 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qs-lll/android-ipfs-api/61a8733b0422d6d8c7e11db6f1bda036b79edf94/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qs-lll/android-ipfs-api/61a8733b0422d6d8c7e11db6f1bda036b79edf94/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qs-lll/android-ipfs-api/61a8733b0422d6d8c7e11db6f1bda036b79edf94/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qs-lll/android-ipfs-api/61a8733b0422d6d8c7e11db6f1bda036b79edf94/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qs-lll/android-ipfs-api/61a8733b0422d6d8c7e11db6f1bda036b79edf94/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qs-lll/android-ipfs-api/61a8733b0422d6d8c7e11db6f1bda036b79edf94/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qs-lll/android-ipfs-api/61a8733b0422d6d8c7e11db6f1bda036b79edf94/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qs-lll/android-ipfs-api/61a8733b0422d6d8c7e11db6f1bda036b79edf94/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qs-lll/android-ipfs-api/61a8733b0422d6d8c7e11db6f1bda036b79edf94/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qs-lll/android-ipfs-api/61a8733b0422d6d8c7e11db6f1bda036b79edf94/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #3F51B5 4 | #303F9F 5 | #FF4081 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | android-ipfs-api 3 | 4 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/test/java/org/ipfsbox/android_ipfs_api/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package org.ipfsbox.android_ipfs_api; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * @see Testing documentation 11 | */ 12 | public class ExampleUnitTest { 13 | @Test 14 | public void addition_isCorrect() { 15 | assertEquals(4, 2 + 2); 16 | } 17 | } -------------------------------------------------------------------------------- /build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | 5 | repositories { 6 | google() 7 | jcenter() 8 | } 9 | dependencies { 10 | classpath 'com.android.tools.build:gradle:3.1.1' 11 | 12 | 13 | // NOTE: Do not place your application dependencies here; they belong 14 | // in the individual module build.gradle files 15 | } 16 | } 17 | 18 | allprojects { 19 | repositories { 20 | google() 21 | jcenter() 22 | } 23 | } 24 | 25 | task clean(type: Delete) { 26 | delete rootProject.buildDir 27 | } 28 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | # IDE (e.g. Android Studio) users: 3 | # Gradle settings configured through the IDE *will override* 4 | # any settings specified in this file. 5 | # For more details on how to configure your build environment visit 6 | # http://www.gradle.org/docs/current/userguide/build_environment.html 7 | # Specifies the JVM arguments used for the daemon process. 8 | # The setting is particularly useful for tweaking memory settings. 9 | org.gradle.jvmargs=-Xmx1536m 10 | # When configured, Gradle will run in incubating parallel mode. 11 | # This option should only be used with decoupled projects. More details, visit 12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 13 | # org.gradle.parallel=true 14 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qs-lll/android-ipfs-api/61a8733b0422d6d8c7e11db6f1bda036b79edf94/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Mon May 07 20:55:42 CST 2018 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip 7 | -------------------------------------------------------------------------------- /gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Attempt to set APP_HOME 10 | # Resolve links: $0 may be a link 11 | PRG="$0" 12 | # Need this for relative symlinks. 13 | while [ -h "$PRG" ] ; do 14 | ls=`ls -ld "$PRG"` 15 | link=`expr "$ls" : '.*-> \(.*\)$'` 16 | if expr "$link" : '/.*' > /dev/null; then 17 | PRG="$link" 18 | else 19 | PRG=`dirname "$PRG"`"/$link" 20 | fi 21 | done 22 | SAVED="`pwd`" 23 | cd "`dirname \"$PRG\"`/" >/dev/null 24 | APP_HOME="`pwd -P`" 25 | cd "$SAVED" >/dev/null 26 | 27 | APP_NAME="Gradle" 28 | APP_BASE_NAME=`basename "$0"` 29 | 30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 31 | DEFAULT_JVM_OPTS="" 32 | 33 | # Use the maximum available, or set MAX_FD != -1 to use that value. 34 | MAX_FD="maximum" 35 | 36 | warn () { 37 | echo "$*" 38 | } 39 | 40 | die () { 41 | echo 42 | echo "$*" 43 | echo 44 | exit 1 45 | } 46 | 47 | # OS specific support (must be 'true' or 'false'). 48 | cygwin=false 49 | msys=false 50 | darwin=false 51 | nonstop=false 52 | case "`uname`" in 53 | CYGWIN* ) 54 | cygwin=true 55 | ;; 56 | Darwin* ) 57 | darwin=true 58 | ;; 59 | MINGW* ) 60 | msys=true 61 | ;; 62 | NONSTOP* ) 63 | nonstop=true 64 | ;; 65 | esac 66 | 67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 68 | 69 | # Determine the Java command to use to start the JVM. 70 | if [ -n "$JAVA_HOME" ] ; then 71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 72 | # IBM's JDK on AIX uses strange locations for the executables 73 | JAVACMD="$JAVA_HOME/jre/sh/java" 74 | else 75 | JAVACMD="$JAVA_HOME/bin/java" 76 | fi 77 | if [ ! -x "$JAVACMD" ] ; then 78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 79 | 80 | Please set the JAVA_HOME variable in your environment to match the 81 | location of your Java installation." 82 | fi 83 | else 84 | JAVACMD="java" 85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 86 | 87 | Please set the JAVA_HOME variable in your environment to match the 88 | location of your Java installation." 89 | fi 90 | 91 | # Increase the maximum file descriptors if we can. 92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then 93 | MAX_FD_LIMIT=`ulimit -H -n` 94 | if [ $? -eq 0 ] ; then 95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 96 | MAX_FD="$MAX_FD_LIMIT" 97 | fi 98 | ulimit -n $MAX_FD 99 | if [ $? -ne 0 ] ; then 100 | warn "Could not set maximum file descriptor limit: $MAX_FD" 101 | fi 102 | else 103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 104 | fi 105 | fi 106 | 107 | # For Darwin, add options to specify how the application appears in the dock 108 | if $darwin; then 109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 110 | fi 111 | 112 | # For Cygwin, switch paths to Windows format before running java 113 | if $cygwin ; then 114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 116 | JAVACMD=`cygpath --unix "$JAVACMD"` 117 | 118 | # We build the pattern for arguments to be converted via cygpath 119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 120 | SEP="" 121 | for dir in $ROOTDIRSRAW ; do 122 | ROOTDIRS="$ROOTDIRS$SEP$dir" 123 | SEP="|" 124 | done 125 | OURCYGPATTERN="(^($ROOTDIRS))" 126 | # Add a user-defined pattern to the cygpath arguments 127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 129 | fi 130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 131 | i=0 132 | for arg in "$@" ; do 133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 135 | 136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 138 | else 139 | eval `echo args$i`="\"$arg\"" 140 | fi 141 | i=$((i+1)) 142 | done 143 | case $i in 144 | (0) set -- ;; 145 | (1) set -- "$args0" ;; 146 | (2) set -- "$args0" "$args1" ;; 147 | (3) set -- "$args0" "$args1" "$args2" ;; 148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 154 | esac 155 | fi 156 | 157 | # Escape application args 158 | save () { 159 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done 160 | echo " " 161 | } 162 | APP_ARGS=$(save "$@") 163 | 164 | # Collect all arguments for the java command, following the shell quoting and substitution rules 165 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" 166 | 167 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong 168 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then 169 | cd "$(dirname "$0")" 170 | fi 171 | 172 | exec "$JAVACMD" "$@" 173 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS= 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | 53 | :win9xME_args 54 | @rem Slurp the command line arguments. 55 | set CMD_LINE_ARGS= 56 | set _SKIP=2 57 | 58 | :win9xME_args_slurp 59 | if "x%~1" == "x" goto execute 60 | 61 | set CMD_LINE_ARGS=%* 62 | 63 | :execute 64 | @rem Setup the command line 65 | 66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 67 | 68 | @rem Execute Gradle 69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 70 | 71 | :end 72 | @rem End local scope for the variables with windows NT shell 73 | if "%ERRORLEVEL%"=="0" goto mainEnd 74 | 75 | :fail 76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 77 | rem the _cmd.exe /c_ return code! 78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 79 | exit /b 1 80 | 81 | :mainEnd 82 | if "%OS%"=="Windows_NT" endlocal 83 | 84 | :omega 85 | -------------------------------------------------------------------------------- /library/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /library/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | android { 4 | compileSdkVersion 26 5 | 6 | 7 | 8 | defaultConfig { 9 | minSdkVersion 15 10 | targetSdkVersion 26 11 | versionCode 1 12 | versionName "1.0" 13 | 14 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 15 | 16 | } 17 | 18 | buildTypes { 19 | release { 20 | minifyEnabled false 21 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 22 | } 23 | } 24 | 25 | } 26 | 27 | dependencies { 28 | implementation fileTree(dir: 'libs', include: ['*.jar']) 29 | 30 | implementation 'com.android.support:appcompat-v7:26.1.0' 31 | testImplementation 'junit:junit:4.12' 32 | androidTestImplementation 'com.android.support.test:runner:1.0.2' 33 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' 34 | 35 | implementation 'com.squareup.retrofit2:retrofit:2.4.0' 36 | compile 'com.google.code.gson:gson:2.6.2' 37 | implementation 'com.squareup.retrofit2:retrofit-converters:2.4.0' 38 | implementation 'com.squareup.retrofit2:retrofit-adapters:2.4.0' 39 | compile 'com.squareup.retrofit2:converter-gson:2.4.0' 40 | } 41 | -------------------------------------------------------------------------------- /library/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /library/src/androidTest/java/org/ipfsbox/library/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package org.ipfsbox.library; 2 | 3 | import android.content.Context; 4 | import android.support.test.InstrumentationRegistry; 5 | import android.support.test.runner.AndroidJUnit4; 6 | 7 | import org.junit.Test; 8 | import org.junit.runner.RunWith; 9 | 10 | import static org.junit.Assert.*; 11 | 12 | /** 13 | * Instrumented test, which will execute on an Android device. 14 | * 15 | * @see Testing documentation 16 | */ 17 | @RunWith(AndroidJUnit4.class) 18 | public class ExampleInstrumentedTest { 19 | @Test 20 | public void useAppContext() { 21 | // Context of the app under test. 22 | Context appContext = InstrumentationRegistry.getTargetContext(); 23 | 24 | assertEquals("org.ipfsbox.library.test", appContext.getPackageName()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /library/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | -------------------------------------------------------------------------------- /library/src/main/java/org/ipfsbox/library/Bitswap.java: -------------------------------------------------------------------------------- 1 | package org.ipfsbox.library; 2 | 3 | import org.ipfsbox.library.entity.Bitswap_stat; 4 | import org.ipfsbox.library.service.CommandService; 5 | 6 | import retrofit2.Call; 7 | import retrofit2.Retrofit; 8 | 9 | public class Bitswap { 10 | Retrofit retrofit; 11 | 12 | public Bitswap(Retrofit retrofit) { 13 | this.retrofit = retrofit; 14 | } 15 | 16 | public void ledger() { 17 | 18 | } 19 | 20 | public void reprovide() { 21 | 22 | } 23 | public void stat(retrofit2.Callback callback) { 24 | CommandService.bitswap commandService = retrofit.create(CommandService.bitswap.class); 25 | Call bitswap_statCall = commandService.stat(); 26 | bitswap_statCall.enqueue(callback); 27 | 28 | } 29 | public void unwant() { 30 | 31 | } 32 | public void wantlist() { 33 | 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /library/src/main/java/org/ipfsbox/library/Block.java: -------------------------------------------------------------------------------- 1 | package org.ipfsbox.library; 2 | 3 | import retrofit2.Retrofit; 4 | 5 | public class Block { 6 | Retrofit retrofit; 7 | 8 | public Block(Retrofit retrofit) { 9 | this.retrofit = retrofit; 10 | } 11 | 12 | public void get() { 13 | 14 | } 15 | public void put() { 16 | 17 | } 18 | public void rm() { 19 | 20 | } 21 | public void stat() { 22 | 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /library/src/main/java/org/ipfsbox/library/Bootstrap.java: -------------------------------------------------------------------------------- 1 | package org.ipfsbox.library; 2 | 3 | import retrofit2.Retrofit; 4 | 5 | public class Bootstrap { 6 | Retrofit retrofit; 7 | 8 | public Bootstrap(Retrofit retrofit) { 9 | this.retrofit = retrofit; 10 | } 11 | 12 | public add add() { 13 | return new add(retrofit); 14 | } 15 | 16 | public rm rm() { 17 | 18 | return new rm(retrofit); 19 | } 20 | 21 | public void list() { 22 | 23 | } 24 | 25 | public class add { 26 | Retrofit retrofit; 27 | 28 | public add(Retrofit retrofit) { 29 | this.retrofit = retrofit; 30 | } 31 | 32 | public void Default() { 33 | 34 | } 35 | } 36 | 37 | public class rm { 38 | Retrofit retrofit; 39 | 40 | public rm(Retrofit retrofit) { 41 | this.retrofit = retrofit; 42 | } 43 | 44 | public void all() { 45 | 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /library/src/main/java/org/ipfsbox/library/Callback.java: -------------------------------------------------------------------------------- 1 | package org.ipfsbox.library; 2 | 3 | import retrofit2.Call; 4 | import retrofit2.Response; 5 | 6 | public abstract class Callback implements retrofit2.Callback { 7 | @Override 8 | public void onResponse(Call call, Response response) { 9 | // response.; 10 | // response.body(). 11 | } 12 | 13 | @Override 14 | public void onFailure(Call call, Throwable t) { 15 | 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /library/src/main/java/org/ipfsbox/library/Config.java: -------------------------------------------------------------------------------- 1 | package org.ipfsbox.library; 2 | 3 | import org.ipfsbox.library.service.CommandService; 4 | 5 | import retrofit2.Callback; 6 | import retrofit2.Retrofit; 7 | 8 | public class Config { 9 | Retrofit retrofit; 10 | 11 | /** 12 | * can not used!!!! 13 | * ENV variable $EDITOR not set 14 | */ 15 | public void edit() { 16 | 17 | } 18 | 19 | public void replace() { 20 | 21 | } 22 | 23 | /** 24 | * todo this show config is not complete 25 | */ 26 | public void show(Callback callback) { 27 | CommandService.config config = retrofit.create(CommandService.config.class); 28 | config.show().enqueue(callback); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /library/src/main/java/org/ipfsbox/library/Dag.java: -------------------------------------------------------------------------------- 1 | package org.ipfsbox.library; 2 | 3 | import org.ipfsbox.library.service.CommandService; 4 | 5 | import retrofit2.Callback; 6 | import retrofit2.Retrofit; 7 | 8 | public class Dag { 9 | Retrofit retrofit; 10 | 11 | public Dag(Retrofit retrofit) { 12 | this.retrofit = retrofit; 13 | } 14 | 15 | public void get(Callback callback, String hash) { 16 | CommandService.dag dag = retrofit.create(CommandService.dag.class); 17 | dag.get(hash).enqueue(callback); 18 | } 19 | 20 | public void put() { 21 | 22 | } 23 | 24 | public void resolve() { 25 | 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /library/src/main/java/org/ipfsbox/library/Dht.java: -------------------------------------------------------------------------------- 1 | package org.ipfsbox.library; 2 | 3 | import retrofit2.Retrofit; 4 | 5 | public class Dht { 6 | Retrofit retrofit; 7 | 8 | public Dht(Retrofit retrofit) { 9 | this.retrofit = retrofit; 10 | } 11 | public void findpeer() { 12 | 13 | } 14 | public void findprovs() { 15 | 16 | } 17 | public void get() { 18 | 19 | } 20 | public void provide() { 21 | 22 | } 23 | public void put() { 24 | 25 | } 26 | public void query() { 27 | 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /library/src/main/java/org/ipfsbox/library/Diag.java: -------------------------------------------------------------------------------- 1 | package org.ipfsbox.library; 2 | 3 | import retrofit2.Retrofit; 4 | 5 | public class Diag { 6 | Retrofit retrofit; 7 | 8 | public Diag(Retrofit retrofit) { 9 | this.retrofit = retrofit; 10 | } 11 | 12 | public void sys() { 13 | 14 | } 15 | 16 | public class cmds { 17 | Retrofit retrofit; 18 | 19 | public cmds(Retrofit retrofit) { 20 | this.retrofit = retrofit; 21 | } 22 | 23 | public void clear() { 24 | 25 | } 26 | 27 | public void set_time() { 28 | 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /library/src/main/java/org/ipfsbox/library/File.java: -------------------------------------------------------------------------------- 1 | package org.ipfsbox.library; 2 | 3 | import retrofit2.Retrofit; 4 | 5 | public class File { 6 | Retrofit retrofit; 7 | 8 | public File(Retrofit retrofit) { 9 | this.retrofit = retrofit; 10 | } 11 | public void ls() { 12 | 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /library/src/main/java/org/ipfsbox/library/FileStore.java: -------------------------------------------------------------------------------- 1 | package org.ipfsbox.library; 2 | 3 | import retrofit2.Retrofit; 4 | 5 | public class FileStore { 6 | Retrofit retrofit; 7 | 8 | public FileStore(Retrofit retrofit) { 9 | this.retrofit = retrofit; 10 | } 11 | public void dups() { 12 | 13 | } 14 | public void ls() { 15 | 16 | } 17 | public void verify() { 18 | 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /library/src/main/java/org/ipfsbox/library/Files.java: -------------------------------------------------------------------------------- 1 | package org.ipfsbox.library; 2 | 3 | import retrofit2.Retrofit; 4 | 5 | public class Files { 6 | Retrofit retrofit; 7 | 8 | public Files(Retrofit retrofit) { 9 | this.retrofit = retrofit; 10 | } 11 | public void ls() { 12 | 13 | } 14 | public void cp() { 15 | 16 | } 17 | public void flush() { 18 | 19 | } 20 | public void mkdir() { 21 | 22 | } 23 | public void mv() { 24 | 25 | } 26 | public void read() { 27 | 28 | } 29 | public void rm() { 30 | 31 | } 32 | public void stat() { 33 | 34 | } 35 | public void write() { 36 | 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /library/src/main/java/org/ipfsbox/library/IpfsBox.java: -------------------------------------------------------------------------------- 1 | package org.ipfsbox.library; 2 | 3 | import android.util.Log; 4 | 5 | import org.ipfsbox.library.entity.Commands; 6 | import org.ipfsbox.library.entity.Id; 7 | import org.ipfsbox.library.entity.Version; 8 | import org.ipfsbox.library.service.CommandService; 9 | 10 | import java.io.File; 11 | 12 | import okhttp3.MediaType; 13 | import okhttp3.MultipartBody; 14 | import okhttp3.RequestBody; 15 | import retrofit2.Call; 16 | import retrofit2.Retrofit; 17 | import retrofit2.converter.gson.GsonConverterFactory; 18 | 19 | public class IpfsBox { 20 | Retrofit retrofit; 21 | 22 | /** 23 | * use default url 24 | */ 25 | public IpfsBox() { 26 | this("http://127.0.0.1:5001"); 27 | } 28 | 29 | public IpfsBox(String baseUrl) { 30 | retrofit = new Retrofit.Builder().baseUrl(baseUrl + "/api/v0/").addConverterFactory(GsonConverterFactory.create()).build(); 31 | // ApiService apiService = retrofit.create(ApiService.class); 32 | } 33 | 34 | 35 | public void add(retrofit2.Callback callback, String path) { 36 | CommandService commandService = retrofit.create(CommandService.class); 37 | File file = new File(path); 38 | Log.e("log", file.length() + ""); 39 | RequestBody requestBody = RequestBody.create(MediaType.parse("video/mp4"), file); 40 | MultipartBody.Part data = MultipartBody.Part.createFormData("data", file.getName(), requestBody); 41 | Call add = commandService.add(data); 42 | add.enqueue(callback); 43 | } 44 | 45 | public void version(retrofit2.Callback callback) { 46 | CommandService commandService = retrofit.create(CommandService.class); 47 | Call version = commandService.version(); 48 | version.enqueue(callback); 49 | } 50 | 51 | /** 52 | * need download FILE? 53 | * 54 | * @param callback 55 | */ 56 | public void cat(retrofit2.Callback callback) { 57 | 58 | } 59 | 60 | public void commands(retrofit2.Callback callback) { 61 | CommandService commandService = retrofit.create(CommandService.class); 62 | commandService.commands().enqueue(callback); 63 | 64 | } 65 | 66 | public void dns(retrofit2.Callback callback) { 67 | 68 | } 69 | 70 | public void get(retrofit2.Callback callback) { 71 | 72 | } 73 | 74 | public void id(retrofit2.Callback callback) { 75 | CommandService commandService = retrofit.create(CommandService.class); 76 | Call id = commandService.id(); 77 | id.enqueue(callback); 78 | } 79 | 80 | public void ls(retrofit2.Callback callback) { 81 | 82 | } 83 | 84 | public void mount(retrofit2.Callback callback) { 85 | 86 | } 87 | 88 | public void ping(retrofit2.Callback callback) { 89 | 90 | } 91 | 92 | public void resolve(retrofit2.Callback callback) { 93 | 94 | } 95 | 96 | public void shutdown(retrofit2.Callback callback) { 97 | 98 | } 99 | 100 | /** 101 | * cant use now 102 | * @param callback 103 | */ 104 | public void update(retrofit2.Callback callback) { 105 | 106 | } 107 | 108 | public Stats stats() { 109 | return new Stats(retrofit); 110 | } 111 | 112 | public Pin pin() { 113 | return new Pin(retrofit); 114 | } 115 | 116 | public Bootstrap bootstrap() { 117 | return new Bootstrap(retrofit); 118 | } 119 | 120 | public Swarm swarm() { 121 | return new Swarm(retrofit); 122 | } 123 | 124 | public Config config() { 125 | return new Config(); 126 | } 127 | 128 | public Dag dag() { 129 | return new Dag(retrofit); 130 | } 131 | public Bitswap bitswap() { 132 | return new Bitswap(retrofit); 133 | } 134 | } 135 | -------------------------------------------------------------------------------- /library/src/main/java/org/ipfsbox/library/Key.java: -------------------------------------------------------------------------------- 1 | package org.ipfsbox.library; 2 | 3 | import retrofit2.Retrofit; 4 | 5 | public class Key { 6 | Retrofit retrofit; 7 | 8 | public Key(Retrofit retrofit) { 9 | this.retrofit = retrofit; 10 | } 11 | public void gen() { 12 | 13 | } 14 | public void list() { 15 | 16 | } 17 | public void rename() { 18 | 19 | } 20 | public void rm() { 21 | 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /library/src/main/java/org/ipfsbox/library/Log.java: -------------------------------------------------------------------------------- 1 | package org.ipfsbox.library; 2 | 3 | import retrofit2.Retrofit; 4 | 5 | public class Log { 6 | Retrofit retrofit; 7 | 8 | public Log(Retrofit retrofit) { 9 | this.retrofit = retrofit; 10 | } 11 | public void level() { 12 | 13 | } 14 | public void ls() { 15 | 16 | } 17 | public void tail() { 18 | 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /library/src/main/java/org/ipfsbox/library/Name.java: -------------------------------------------------------------------------------- 1 | package org.ipfsbox.library; 2 | 3 | import retrofit2.Retrofit; 4 | 5 | public class Name { 6 | Retrofit retrofit; 7 | 8 | public Name(Retrofit retrofit) { 9 | this.retrofit = retrofit; 10 | } 11 | public void publish() { 12 | 13 | } 14 | public void resolve() { 15 | 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /library/src/main/java/org/ipfsbox/library/Object.java: -------------------------------------------------------------------------------- 1 | package org.ipfsbox.library; 2 | 3 | import retrofit2.Retrofit; 4 | 5 | public class Object { 6 | Retrofit retrofit; 7 | 8 | public Object(Retrofit retrofit) { 9 | this.retrofit = retrofit; 10 | } 11 | 12 | public void data() { 13 | 14 | } 15 | 16 | public void diff() { 17 | 18 | } 19 | 20 | public void get() { 21 | } 22 | 23 | public void links() { 24 | } 25 | 26 | public void New() { 27 | } 28 | 29 | public patch patch() { 30 | return new patch(retrofit); 31 | } 32 | 33 | public void put() { 34 | } 35 | 36 | public void stat() { 37 | } 38 | 39 | public class patch { 40 | Retrofit retrofit; 41 | 42 | public patch(Retrofit retrofit) { 43 | this.retrofit = retrofit; 44 | } 45 | 46 | public void add_link() { 47 | } 48 | 49 | public void append_data() { 50 | } 51 | 52 | public void rm_link() { 53 | } 54 | 55 | public void set_data() { 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /library/src/main/java/org/ipfsbox/library/P2p.java: -------------------------------------------------------------------------------- 1 | package org.ipfsbox.library; 2 | 3 | import retrofit2.Retrofit; 4 | 5 | public class P2p { 6 | Retrofit retrofit; 7 | 8 | public P2p(Retrofit retrofit) { 9 | this.retrofit = retrofit; 10 | } 11 | 12 | public listener listener() { 13 | return new listener(retrofit); 14 | } 15 | 16 | public stream stream() { 17 | return new stream(retrofit); 18 | } 19 | 20 | public class listener { 21 | Retrofit retrofit; 22 | 23 | public listener(Retrofit retrofit) { 24 | this.retrofit = retrofit; 25 | } 26 | 27 | public void close() { 28 | 29 | } 30 | 31 | public void ls() { 32 | 33 | } 34 | 35 | public void open() { 36 | 37 | } 38 | } 39 | 40 | public class stream { 41 | Retrofit retrofit; 42 | 43 | public stream(Retrofit retrofit) { 44 | this.retrofit = retrofit; 45 | } 46 | 47 | public void close() { 48 | 49 | } 50 | 51 | public void dial() { 52 | 53 | } 54 | 55 | public void ls() { 56 | 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /library/src/main/java/org/ipfsbox/library/Pin.java: -------------------------------------------------------------------------------- 1 | package org.ipfsbox.library; 2 | 3 | import org.ipfsbox.library.service.CommandService; 4 | 5 | import retrofit2.Call; 6 | import retrofit2.Callback; 7 | import retrofit2.Retrofit; 8 | 9 | class Pin { 10 | Retrofit retrofit; 11 | 12 | enum LsType { 13 | direct, indirect, recursive, all 14 | } 15 | 16 | public Pin(Retrofit retrofit) { 17 | this.retrofit = retrofit; 18 | } 19 | 20 | public void add() { 21 | } 22 | 23 | public void rm() { 24 | } 25 | 26 | public void update() { 27 | } 28 | 29 | public void verify() { 30 | } 31 | 32 | public void ls(Callback callback, LsType type) { 33 | CommandService.pin pin = retrofit.create(CommandService.pin.class); 34 | Call ls = pin.ls(type.name()); 35 | ls.enqueue(callback); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /library/src/main/java/org/ipfsbox/library/Pubsub.java: -------------------------------------------------------------------------------- 1 | package org.ipfsbox.library; 2 | 3 | import retrofit2.Retrofit; 4 | 5 | public class Pubsub { 6 | Retrofit retrofit; 7 | 8 | public Pubsub(Retrofit retrofit) { 9 | this.retrofit = retrofit; 10 | } 11 | 12 | public void ls() { 13 | } 14 | 15 | public void peers() { 16 | } 17 | 18 | public void pub() { 19 | } 20 | 21 | public void sub() { 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /library/src/main/java/org/ipfsbox/library/Refs.java: -------------------------------------------------------------------------------- 1 | package org.ipfsbox.library; 2 | 3 | import retrofit2.Retrofit; 4 | 5 | public class Refs { 6 | Retrofit retrofit; 7 | 8 | public Refs(Retrofit retrofit) { 9 | this.retrofit = retrofit; 10 | } 11 | public void local() { 12 | 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /library/src/main/java/org/ipfsbox/library/Repo.java: -------------------------------------------------------------------------------- 1 | package org.ipfsbox.library; 2 | 3 | import retrofit2.Retrofit; 4 | 5 | public class Repo { 6 | Retrofit retrofit; 7 | 8 | public Repo(Retrofit retrofit) { 9 | this.retrofit = retrofit; 10 | } 11 | 12 | public void fsck() { 13 | } 14 | 15 | public void gc() { 16 | } 17 | 18 | public void stat() { 19 | } 20 | 21 | public void verify() { 22 | } 23 | 24 | public void version() { 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /library/src/main/java/org/ipfsbox/library/Stats.java: -------------------------------------------------------------------------------- 1 | package org.ipfsbox.library; 2 | 3 | import org.ipfsbox.library.entity.Stats_bw; 4 | import org.ipfsbox.library.service.CommandService; 5 | 6 | import retrofit2.Call; 7 | import retrofit2.Callback; 8 | import retrofit2.Retrofit; 9 | 10 | public class Stats { 11 | Retrofit retrofit; 12 | 13 | public Stats(Retrofit retrofit) { 14 | this.retrofit = retrofit; 15 | } 16 | 17 | public void bitswap() { 18 | } 19 | 20 | public void bw(Callback callback) { 21 | CommandService.stats stats = retrofit.create(CommandService.stats.class); 22 | Call bw = stats.bw(); 23 | bw.enqueue(callback); 24 | 25 | } 26 | 27 | public void repo() { 28 | } 29 | 30 | 31 | } 32 | -------------------------------------------------------------------------------- /library/src/main/java/org/ipfsbox/library/Swarm.java: -------------------------------------------------------------------------------- 1 | package org.ipfsbox.library; 2 | 3 | import org.ipfsbox.library.service.CommandService; 4 | 5 | import retrofit2.Callback; 6 | import retrofit2.Retrofit; 7 | 8 | public class Swarm { 9 | Retrofit retrofit; 10 | 11 | public Swarm(Retrofit retrofit) { 12 | this.retrofit = retrofit; 13 | } 14 | 15 | public void connect(Callback callback, String path) { 16 | CommandService.swarm swarm = retrofit.create(CommandService.swarm.class); 17 | swarm.connect(path).enqueue(callback); 18 | } 19 | 20 | public void disconnect() { 21 | } 22 | 23 | public void peers() { 24 | } 25 | 26 | public addrs addrs() { 27 | return new addrs(retrofit); 28 | } 29 | 30 | public filters filters() { 31 | return new filters(retrofit); 32 | } 33 | 34 | public class addrs { 35 | Retrofit retrofit; 36 | 37 | public addrs(Retrofit retrofit) { 38 | this.retrofit = retrofit; 39 | } 40 | 41 | public void listen() { 42 | } 43 | 44 | public void local() { 45 | } 46 | } 47 | 48 | public class filters { 49 | Retrofit retrofit; 50 | 51 | public filters(Retrofit retrofit) { 52 | this.retrofit = retrofit; 53 | } 54 | 55 | public void add() { 56 | } 57 | 58 | public void rm() { 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /library/src/main/java/org/ipfsbox/library/Tar.java: -------------------------------------------------------------------------------- 1 | package org.ipfsbox.library; 2 | 3 | import retrofit2.Retrofit; 4 | 5 | public class Tar { 6 | Retrofit retrofit; 7 | 8 | public Tar(Retrofit retrofit) { 9 | this.retrofit = retrofit; 10 | } 11 | 12 | public void add() { 13 | } 14 | 15 | public void cat() { 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /library/src/main/java/org/ipfsbox/library/Util.java: -------------------------------------------------------------------------------- 1 | package org.ipfsbox.library; 2 | 3 | 4 | import retrofit2.Call; 5 | import retrofit2.Callback; 6 | import retrofit2.Response; 7 | 8 | public class Util { 9 | public void enqueue(Call call, Callback callback) { 10 | call.enqueue(new Callback() { 11 | @Override 12 | public void onResponse(Call call, Response response) { 13 | 14 | } 15 | 16 | @Override 17 | public void onFailure(Call call, Throwable t) { 18 | 19 | } 20 | }); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /library/src/main/java/org/ipfsbox/library/entity/Add.java: -------------------------------------------------------------------------------- 1 | package org.ipfsbox.library.entity; 2 | 3 | public class Add { 4 | /** 5 | * Name : close.png 6 | * Hash : QmdYUDvdY7vXjWYYg1gqT9EdgcYaRJe1gfW8H6jxGaWAKF 7 | * Size : 2926 8 | */ 9 | 10 | private String Name; 11 | private String Hash; 12 | private String Size; 13 | 14 | public String getName() { 15 | return Name; 16 | } 17 | 18 | public void setName(String Name) { 19 | this.Name = Name; 20 | } 21 | 22 | public String getHash() { 23 | return Hash; 24 | } 25 | 26 | public void setHash(String Hash) { 27 | this.Hash = Hash; 28 | } 29 | 30 | public String getSize() { 31 | return Size; 32 | } 33 | 34 | public void setSize(String Size) { 35 | this.Size = Size; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /library/src/main/java/org/ipfsbox/library/entity/Bitswap_stat.java: -------------------------------------------------------------------------------- 1 | package org.ipfsbox.library.entity; 2 | 3 | import java.util.List; 4 | 5 | public class Bitswap_stat { 6 | 7 | /** 8 | * ProvideBufLen : 0 9 | * Wantlist : [] 10 | * Peers : ["QmNSYxZAiJHeLdkBg38roksAR9So7Y5eojks1yjEcUtZ7i","QmNX9nSos8sRFvqGTwdEme6LQ8R1eJ8EuFgW32F9jjp2Pb","QmNaEYqfjYtJjneSjpmFd3U5UEYopeYTxTqqYtRUDRuV88","QmNbEDD6CWjeUj1nixiv3RtvuGQrNZ84BBBKYkTTDay8ph","QmNe5CK9EWEZYttijNJ4gaGuHLsjNbjHbj9MdM6XAJR9es","QmNeRdNQE2zYwhLS2wQxKjyTJdorVouLDtLifcZuGiiqoi","QmNjXfayySzAHodkFXDATukc2UthAP3tpNEjFQcgpwA4Pp","QmNoQCDF8fRncKUVux3bvqqWs2FBFhyCcSJG9JF49ZZZEB","QmNwkcA6xhoF5914pyyo6EA3wfcsstb1gRqwSmgYgbkfgJ","QmP6JzWD2GgwmU1NatFi2XAKqVsEEnyHX97gS2fz5xCm66","QmPDV1NT6fazNqoBWCKKoRyvaLtG8cXApuYo7iQKnjvhpB","QmPaqDnshtCHPLM4z9wq2sJbiRBCxaHvwWRrxgGc13JMDY","QmPbZ3SDgmTNEB1gNSE9DEf4xT8eag3AFn5uo7X39TbZM8","QmPp1xaJcmsSvBw7mXEK4jBWK2u2GQ4W52mUQfc6y8Uoo5","QmPpHYLC99FEhn31EJzyDyjdTdLGt7XdTVZUpHyFNNkYdP","QmPz3CyRYrtXDxzKwRBwu2R6sHo3uW9E38uz48T8Ln7fcs","QmQArKLQkH76TFCA6iEs9PN2RAt5v1VwuozqYdE1BiUzgo","QmQCMmJPycB3CJtAeG8ivkAvRJJRMU63sLAfHaHDyxjDth","QmQDj7tke8fBby556Bdsbr6hMa4xAgqov3EoiGYSScGtRh","QmQJ4F3PwGcJvng4nBqmtkVdnGnuStRTDuuzBqhBzuZV7v","QmQJXmiqdjNLEYy4MjJoiDi5ZeGuUaZWuvHgf6kK49v4co","QmQU44stcUWM9ddmYmXT5q2FCfnvhx7KeidQ1hTVcwPU76","QmQXskT8M1PZqH3Ni6z3Q8oRNCf2KDgT2UzUn6a2QdPp9b","QmQYjtZFYLKiTohLsMDGyNNuFhY6X6UfdDEYaMB8DEy1Vx","QmQa3qfGY3AV4JjbgR87CjTinhLaGagviq3Y1L6nFJBR8i","QmQbgwYuA8M7VsRv7XTkjy2qiq4eDNGhDrHCQaxkgxygmh","QmQph6WdnVKQycxBqrC1mGAANc6NhBA3huRrSoF2KH3KBd","QmQv1fF3jQ7sFm48XjCVBk2HUhnEh9L1PaybawZfHjC5W9","QmRCKPpW8BWPkNLWtk4Vuy7MtSiYDHjuztb2b4LtA4tWS3","QmRUSwjXRFictSy3VFEFEvsSMLfaj73Z3tJxqvkvaPS2CV","QmRcT1Wdxfd5mQpa9GhpK3hPPm2MqmNvFELUXqtZXTyGj7","QmRciwi6KqjjDA1dDcukmjFt7LSrsHLhQsCQB7VypzAETW","QmRiAM4XyMqWhiWmwFwVfD8uLQf1SQaYQJqp7tRQ1NUFSh","QmRkmZ3fnY3dZmZHLqx18QHZav3F3EceNUDyBsB2tuMmGv","QmSFroV2FSXuHtMwaPP3rRno5MawQiY4cCMbWnn5DtGngQ","QmSJv9Xmqw8oYhdTAUVfF98ZrjxYpJrieedoHTvRAmwSQ9","QmSMSC9SmN1wmfPsiCHxm5uuprL1ciRxkpaUqXRDkGCSDU","QmSU4fSgfwfLnTuZPmxX29GWWov486Y9q6rjesYYDdPhnf","QmSeG2wQNnEw7HJmP2W4DrFwL9qW5c9FtyfqsaBPHQyvKb","QmSkDigBiYhdRQjNZo6UQzEwEDqTCgEG5zpo5rjLXmTvmX","QmSoLMeWqB7YGVLJN3pNLQpmmEk35v6wYtsMGLzSr5QBU3","QmSoLPppuBtQSGwKDZT2M73ULpjvfd3aZ6ha4oFGL1KrGM","QmSqPav7MUPKycXqwtjderjmxQyP42DjjL86ENb1NZ6grH","QmSv3MDArXcxt5jd9KrACRoDYg7rUJoexJJVtwKC1F3c7v","QmT1ZuP4QW7RL6MapuQNvivVem6ydCqMyq1QeJeyy41ZxU","QmTD8ReGpiXiWtMC9gbZSv6h9WnHptgVpKU2ciCit6eLvv","QmTKYdZDkqHiY24kPynSmKbmRdk7cJxWsvvfvvvZArQ1N9","QmTMEMKoLiLHB6p2UwhBNbodSQrSdBjazcUQ6B1NEZKHBg","QmTUvaGZqEu7qJw6DuTyhTgiZmZwdp7qN4FD4FFV3TGhjM","QmTgBYzah9m9WhXSJnpWCDNLKaZkLLnfoVq6kQ8iJRRVWX","QmTiCerJDqrC6vLDgcNzu8qNK4e9rTx6bJLtSgQHpkUUfk","QmUWABsA7E3wRJrQ6aGKP4AKn2nkkUgPsp9iegjVLsAE1K","QmUn7V9KBcfj36siKNFMMu8dZMTFvEsbTGq5s2R9CAYZfL","QmUyS8LChLMjqtDfgnjZjpGhSSmMcWeH8PXK2GBQynk8HV","QmVFqahYnGkzJknDLTG7Np2KVZoCjcVDbERDw6BbDRvV2f","QmVGX47BzePPqEzpkTwfUJogPZxHcifpSXsGdgyHjtk5t7","QmVGfjk3zd8uUPpt5JTaRqx1UZ2gPqLatYPsMxnt6E4yhf","QmVHhYzauGV7RjMVUfzqukm3upqn98t3PdGNVqBVqUdot6","QmVRfbLHKfhAHAtbDWrdpyHbgYTAihNHc9AcAtSqe9vyt3","QmVkZKrrUKjPpLmgqTSfh3sMwDePGxSjcAMcTdDzBUY4oN","QmVv6yp1xF1DXRdGnCu9WDBzhsMVifpy4nogMrAuLvz5vG","QmWSXjzUMrMdJb11mnyajW9pBGssQ7uVAiWuyfLd7jpoVU","QmWpPMz4ZchwFfsPY9D6cLDLGcogByu8ktJmatWrMz5nT3","QmXCyKownPce795TC4jbc55b3Fcp1Jrua7TQPFr5evRFqp","QmXRnfovmX8yWXVEjTA7pYY9u5apmG1t6GuBttMWneYpBY","QmXRq2osjffUcCah5JhCndj2E1jasGzgT1VYDW44KBnp1f","QmXRxDBWU7zA6yBDtLNM3HMU2W8BRVjRhew42bKHE63yfe","QmXccd7fhQraHFW8Yjg1G6taJ6Hz1Ld6biRfRB1GXEuVPP","QmXmxxxSfchg8ha1gbk9UqnKV8nNGf8LhAwKF7WMumXAXc","QmXoXx9xfRzJz3xHiCobWet33ZMiDGp49U68bwVy1DsN8u","QmYmi7uZqcpTyHH3qzUuWeuSNjbWzDbZ7La58H1mFJg6Tu","QmYuUcjsVQvkqG9fBfeb21G4bs181sSLAH5qqdqUMuUvWD","QmYxoZmhx5kiAd8MK5ZgMF2Co2GpH2xXWSm8T6JPnrwzUt","QmYyAajSFZWmnPJANYGKfToxRZN5psU9cQYBxtidiAi2Vw","QmZBJWYEn76Rnik9nE7kbmWiHLH6uMdRRJuWdn248PwDh4","QmZJvKaxH6Qg1UgLC4h8HDkdPRZAXZrEp9N4nsiaDgob7H","QmZNDMgzpB7bnUWxHw6h1ua7f27hWiSPz58Z4N1G6erZuW","QmZS6z6FAmztnntPS73hXwsRMqUXBSkyafwzNTg3WpphTz","QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ","QmaKpqYwwXMh5e7jduDYouMDhNkAPRi8nxhdPMrMtHUBge","QmaWTQGuE7nmhF5CMJCayBYoohWZUz3nSdEVCANC5XC2hr","Qmakta9xgVvTmzRqrtFVY7VLEe8GKmgi8wm8VAXTs4FNi5","QmakzrgsbAC6yfL6RZCPYE9RoGgmqFyJ6zUkDoiYXeKSzf","QmanzcxHPW8ZxTs1bVHLPX2BP4Je9Ccw8f7uK86WhnWqZY","QmapTzyWjPC1LPSNZ6cB3JzqLCBpX7LAXcn3DepSyHqwbP","Qmape1ua1c8ioWfyaeWEFHgFzcd8MYdUuzqZ2mqefEsk5R","Qmb3Ufz6J8HEeAbqnezdtotu1Bg1FqhBmVssBgcGroNzQU","QmbE7CxKjWymmwbgAZxjKfPxcE4doYqLKbdSHgZnFh1Ypy","QmbNJ7fYJiZYVpVsn2bLfoapMns5bFoWN4or11i1yC63Lf","QmbfA3LYotRee4BgSqih21NjzTzWZqoSSi5xBsDR4kY6Yv","QmbtK4wHAzLK1YCmYECUEQPmXbsUrLLNzKHQ1rDRvzh5cm","QmbzC4ZPFoaQWhKvjfcyCxhJjTFvb542FnBJeh5TR95ndo","QmcBUj1Lx4dFRpZtngNykkMQtnpCkDYNyJq8ua2JDhxZh5","QmcFpZdNbzhY2J6pm13uFRkvHJhtpCsQ9h38Goc24thMDY","QmcHRPA7Mw2psi7ndDdjVGh82xRkHgL1QRai4hjjD6RnW8","QmcPz3DFGzXxrwvuyoc3JKdnwiTN29tgzyNLvyvNawDTst","QmcWRknHParwCVoygtjGjyioUKqMoZbZwGQAY2dHSNyab1","QmcgHHB9t8u6hfanSbfQLXANemT5aYcDHGVgpaWvFuznPe","Qmd3HDoNvhNpjEFEm3z2XsZ79LMw95tRTHakhSqg4FhJad","QmdACfcTWdhB1YCzmRoN2xqLrVL1s4fBCEU8bNQovpwAW5","QmdVZq7EejAKAwzx3a2r3nPFmt9einbzRkCrHzPx3d6w35","QmdnXwLrC8p1ueiq2Qya8joNvk3TVVDAut7PrikmZwubtR","Qme4PeB4U4DhFxozRUo2xgjo16BDFspDh7BdPgN2DVLS4r","QmeP1N3JqH7QBkSdXah7ooedbR5YfPLhg8SqxjJuA3BJ4t","QmeWdgoZezpdHz1PX8Ly8AeDQahFkBNtHn6qKeNtWP1jB6","QmecdJzT2KaUeoDBFv6r7nua7A8fnEQeBqUmdsJtxCBESg","Qmedk2RnGeqUMsGpk1nhgDPHSYZHamruzaKajrAVZ61f2Z","Qmekjemek2b5PNy4Tzwm4F7jtpbLd91U68GB7BNBK49gEn","Qmf5s6qjQojtWz7qQngMAPiCSX6YsV6gDss3bCDruhtWD7","QmfBrRcyriDCWi4mH3aPj3bTAnfx3pVcXqiLUKX24qhr8M"] 11 | * BlocksReceived : 0 12 | * DataReceived : 0 13 | * BlocksSent : 21 14 | * DataSent : 771989 15 | * DupBlksReceived : 0 16 | * DupDataReceived : 0 17 | */ 18 | 19 | private int ProvideBufLen; 20 | private int BlocksReceived; 21 | private int DataReceived; 22 | private int BlocksSent; 23 | private int DataSent; 24 | private int DupBlksReceived; 25 | private int DupDataReceived; 26 | private List Wantlist; 27 | private List Peers; 28 | 29 | public int getProvideBufLen() { 30 | return ProvideBufLen; 31 | } 32 | 33 | public void setProvideBufLen(int ProvideBufLen) { 34 | this.ProvideBufLen = ProvideBufLen; 35 | } 36 | 37 | public int getBlocksReceived() { 38 | return BlocksReceived; 39 | } 40 | 41 | public void setBlocksReceived(int BlocksReceived) { 42 | this.BlocksReceived = BlocksReceived; 43 | } 44 | 45 | public int getDataReceived() { 46 | return DataReceived; 47 | } 48 | 49 | public void setDataReceived(int DataReceived) { 50 | this.DataReceived = DataReceived; 51 | } 52 | 53 | public int getBlocksSent() { 54 | return BlocksSent; 55 | } 56 | 57 | public void setBlocksSent(int BlocksSent) { 58 | this.BlocksSent = BlocksSent; 59 | } 60 | 61 | public int getDataSent() { 62 | return DataSent; 63 | } 64 | 65 | public void setDataSent(int DataSent) { 66 | this.DataSent = DataSent; 67 | } 68 | 69 | public int getDupBlksReceived() { 70 | return DupBlksReceived; 71 | } 72 | 73 | public void setDupBlksReceived(int DupBlksReceived) { 74 | this.DupBlksReceived = DupBlksReceived; 75 | } 76 | 77 | public int getDupDataReceived() { 78 | return DupDataReceived; 79 | } 80 | 81 | public void setDupDataReceived(int DupDataReceived) { 82 | this.DupDataReceived = DupDataReceived; 83 | } 84 | 85 | public List getWantlist() { 86 | return Wantlist; 87 | } 88 | 89 | public void setWantlist(List Wantlist) { 90 | this.Wantlist = Wantlist; 91 | } 92 | 93 | public List getPeers() { 94 | return Peers; 95 | } 96 | 97 | public void setPeers(List Peers) { 98 | this.Peers = Peers; 99 | } 100 | } 101 | -------------------------------------------------------------------------------- /library/src/main/java/org/ipfsbox/library/entity/Commands.java: -------------------------------------------------------------------------------- 1 | package org.ipfsbox.library.entity; 2 | 3 | import java.util.List; 4 | 5 | public class Commands { 6 | 7 | /** 8 | * Name : ipfs 9 | * Subcommands : [{"Name":"add","Subcommands":[],"Options":[{"Names":["recursive","r"]},{"Names":["quiet","q"]},{"Names":["quieter","Q"]},{"Names":["silent"]},{"Names":["progress","p"]},{"Names":["trickle","t"]},{"Names":["only-hash","n"]},{"Names":["wrap-with-directory","w"]},{"Names":["hidden","H"]},{"Names":["chunker","s"]},{"Names":["pin"]},{"Names":["raw-leaves"]},{"Names":["nocopy"]},{"Names":["fscache"]},{"Names":["cid-version"]},{"Names":["hash"]}]},{"Name":"bootstrap","Subcommands":[{"Name":"list","Subcommands":[],"Options":[]},{"Name":"add","Subcommands":[{"Name":"default","Subcommands":[],"Options":[]}],"Options":[{"Names":["default"]}]},{"Name":"rm","Subcommands":[{"Name":"all","Subcommands":[],"Options":[]}],"Options":[{"Names":["all"]}]}],"Options":[]},{"Name":"mount","Subcommands":[],"Options":[{"Names":["ipfs-path","f"]},{"Names":["ipns-path","n"]}]},{"Name":"p2p","Subcommands":[{"Name":"listener","Subcommands":[{"Name":"open","Subcommands":[],"Options":[]},{"Name":"close","Subcommands":[],"Options":[{"Names":["all","a"]}]},{"Name":"ls","Subcommands":[],"Options":[{"Names":["headers","v"]}]}],"Options":[]},{"Name":"stream","Subcommands":[{"Name":"ls","Subcommands":[],"Options":[{"Names":["headers","v"]}]},{"Name":"dial","Subcommands":[],"Options":[]},{"Name":"close","Subcommands":[],"Options":[{"Names":["all","a"]}]}],"Options":[]}],"Options":[]},{"Name":"bitswap","Subcommands":[{"Name":"wantlist","Subcommands":[],"Options":[{"Names":["peer","p"]}]},{"Name":"unwant","Subcommands":[],"Options":[]},{"Name":"ledger","Subcommands":[],"Options":[]},{"Name":"reprovide","Subcommands":[],"Options":[]},{"Name":"stat","Subcommands":[],"Options":[]}],"Options":[]},{"Name":"diag","Subcommands":[{"Name":"sys","Subcommands":[],"Options":[]},{"Name":"cmds","Subcommands":[{"Name":"clear","Subcommands":[],"Options":[]},{"Name":"set-time","Subcommands":[],"Options":[]}],"Options":[{"Names":["verbose","v"]}]}],"Options":[]},{"Name":"shutdown","Subcommands":[],"Options":[]},{"Name":"get","Subcommands":[],"Options":[{"Names":["output","o"]},{"Names":["archive","a"]},{"Names":["compress","C"]},{"Names":["compression-level","l"]}]},{"Name":"stats","Subcommands":[{"Name":"bitswap","Subcommands":[],"Options":[]},{"Name":"bw","Subcommands":[],"Options":[{"Names":["peer","p"]},{"Names":["proto","t"]},{"Names":["poll"]},{"Names":["interval","i"]}]},{"Name":"repo","Subcommands":[],"Options":[{"Names":["human"]}]}],"Options":[]},{"Name":"config","Subcommands":[{"Name":"edit","Subcommands":[],"Options":[]},{"Name":"replace","Subcommands":[],"Options":[]},{"Name":"profile","Subcommands":[{"Name":"apply","Subcommands":[],"Options":[]}],"Options":[]},{"Name":"show","Subcommands":[],"Options":[]}],"Options":[{"Names":["bool"]},{"Names":["json"]}]},{"Name":"dag","Subcommands":[{"Name":"put","Subcommands":[],"Options":[{"Names":["format","f"]},{"Names":["input-enc"]},{"Names":["pin"]},{"Names":["hash"]}]},{"Name":"get","Subcommands":[],"Options":[]},{"Name":"resolve","Subcommands":[],"Options":[]}],"Options":[]},{"Name":"ping","Subcommands":[],"Options":[{"Names":["count","n"]}]},{"Name":"tar","Subcommands":[{"Name":"add","Subcommands":[],"Options":[]},{"Name":"cat","Subcommands":[],"Options":[]}],"Options":[]},{"Name":"block","Subcommands":[{"Name":"stat","Subcommands":[],"Options":[]},{"Name":"get","Subcommands":[],"Options":[]},{"Name":"put","Subcommands":[],"Options":[{"Names":["format","f"]},{"Names":["mhtype"]},{"Names":["mhlen"]}]},{"Name":"rm","Subcommands":[],"Options":[{"Names":["force","f"]},{"Names":["quiet","q"]}]}],"Options":[]},{"Name":"files","Subcommands":[{"Name":"write","Subcommands":[],"Options":[{"Names":["offset","o"]},{"Names":["create","e"]},{"Names":["truncate","t"]},{"Names":["count","n"]},{"Names":["raw-leaves"]},{"Names":["cid-version","cid-ver"]},{"Names":["hash"]}]},{"Name":"cp","Subcommands":[],"Options":[]},{"Name":"ls","Subcommands":[],"Options":[{"Names":["l"]}]},{"Name":"stat","Subcommands":[],"Options":[{"Names":["format"]},{"Names":["hash"]},{"Names":["size"]},{"Names":["with-local"]}]},{"Name":"rm","Subcommands":[],"Options":[{"Names":["recursive","r"]}]},{"Name":"flush","Subcommands":[],"Options":[]},{"Name":"read","Subcommands":[],"Options":[{"Names":["offset","o"]},{"Names":["count","n"]}]},{"Name":"mv","Subcommands":[],"Options":[]},{"Name":"mkdir","Subcommands":[],"Options":[{"Names":["parents","p"]},{"Names":["cid-version","cid-ver"]},{"Names":["hash"]}]},{"Name":"chcid","Subcommands":[],"Options":[{"Names":["cid-version","cid-ver"]},{"Names":["hash"]}]}],"Options":[{"Names":["f","flush"]}]},{"Name":"filestore","Subcommands":[{"Name":"ls","Subcommands":[],"Options":[{"Names":["file-order"]}]},{"Name":"verify","Subcommands":[],"Options":[{"Names":["file-order"]}]},{"Name":"dups","Subcommands":[],"Options":[]}],"Options":[]},{"Name":"pubsub","Subcommands":[{"Name":"pub","Subcommands":[],"Options":[]},{"Name":"sub","Subcommands":[],"Options":[{"Names":["discover"]}]},{"Name":"ls","Subcommands":[],"Options":[]},{"Name":"peers","Subcommands":[],"Options":[]}],"Options":[]},{"Name":"dns","Subcommands":[],"Options":[{"Names":["recursive","r"]}]},{"Name":"id","Subcommands":[],"Options":[{"Names":["format","f"]}]},{"Name":"cat","Subcommands":[],"Options":[{"Names":["offset","o"]},{"Names":["length","l"]}]},{"Name":"name","Subcommands":[{"Name":"publish","Subcommands":[],"Options":[{"Names":["resolve"]},{"Names":["lifetime","t"]},{"Names":["ttl"]},{"Names":["key","k"]}]},{"Name":"resolve","Subcommands":[],"Options":[{"Names":["recursive","r"]},{"Names":["nocache","n"]}]},{"Name":"pubsub","Subcommands":[{"Name":"state","Subcommands":[],"Options":[]},{"Name":"subs","Subcommands":[],"Options":[]},{"Name":"cancel","Subcommands":[],"Options":[]}],"Options":[]}],"Options":[]},{"Name":"resolve","Subcommands":[],"Options":[{"Names":["recursive","r"]}]},{"Name":"file","Subcommands":[{"Name":"ls","Subcommands":[],"Options":[]}],"Options":[]},{"Name":"commands","Subcommands":[],"Options":[{"Names":["flags","f"]}]},{"Name":"repo","Subcommands":[{"Name":"stat","Subcommands":[],"Options":[{"Names":["human"]}]},{"Name":"gc","Subcommands":[],"Options":[{"Names":["stream-errors"]},{"Names":["quiet","q"]}]},{"Name":"fsck","Subcommands":[],"Options":[]},{"Name":"version","Subcommands":[],"Options":[{"Names":["quiet","q"]}]},{"Name":"verify","Subcommands":[],"Options":[]}],"Options":[]},{"Name":"log","Subcommands":[{"Name":"ls","Subcommands":[],"Options":[]},{"Name":"tail","Subcommands":[],"Options":[]},{"Name":"level","Subcommands":[],"Options":[]}],"Options":[]},{"Name":"refs","Subcommands":[{"Name":"local","Subcommands":[],"Options":[]}],"Options":[{"Names":["format"]},{"Names":["edges","e"]},{"Names":["unique","u"]},{"Names":["recursive","r"]}]},{"Name":"update","Subcommands":[],"Options":[]},{"Name":"version","Subcommands":[],"Options":[{"Names":["number","n"]},{"Names":["commit"]},{"Names":["repo"]},{"Names":["all"]}]},{"Name":"dht","Subcommands":[{"Name":"provide","Subcommands":[],"Options":[{"Names":["verbose","v"]},{"Names":["recursive","r"]}]},{"Name":"query","Subcommands":[],"Options":[{"Names":["verbose","v"]}]},{"Name":"findprovs","Subcommands":[],"Options":[{"Names":["verbose","v"]},{"Names":["num-providers","n"]}]},{"Name":"findpeer","Subcommands":[],"Options":[{"Names":["verbose","v"]}]},{"Name":"get","Subcommands":[],"Options":[{"Names":["verbose","v"]}]},{"Name":"put","Subcommands":[],"Options":[{"Names":["verbose","v"]}]}],"Options":[]},{"Name":"key","Subcommands":[{"Name":"rename","Subcommands":[],"Options":[{"Names":["force","f"]}]},{"Name":"rm","Subcommands":[],"Options":[{"Names":["l"]}]},{"Name":"gen","Subcommands":[],"Options":[{"Names":["type","t"]},{"Names":["size","s"]}]},{"Name":"list","Subcommands":[],"Options":[{"Names":["l"]}]}],"Options":[]},{"Name":"ls","Subcommands":[],"Options":[{"Names":["headers","v"]},{"Names":["resolve-type"]}]},{"Name":"object","Subcommands":[{"Name":"patch","Subcommands":[{"Name":"append-data","Subcommands":[],"Options":[]},{"Name":"add-link","Subcommands":[],"Options":[{"Names":["create","p"]}]},{"Name":"rm-link","Subcommands":[],"Options":[]},{"Name":"set-data","Subcommands":[],"Options":[]}],"Options":[]},{"Name":"put","Subcommands":[],"Options":[{"Names":["inputenc"]},{"Names":["datafieldenc"]},{"Names":["pin"]},{"Names":["quiet","q"]}]},{"Name":"stat","Subcommands":[],"Options":[]},{"Name":"data","Subcommands":[],"Options":[]},{"Name":"diff","Subcommands":[],"Options":[{"Names":["verbose","v"]}]},{"Name":"get","Subcommands":[],"Options":[]},{"Name":"links","Subcommands":[],"Options":[{"Names":["headers","v"]}]},{"Name":"new","Subcommands":[],"Options":[]}],"Options":[]},{"Name":"pin","Subcommands":[{"Name":"update","Subcommands":[],"Options":[{"Names":["unpin"]}]},{"Name":"add","Subcommands":[],"Options":[{"Names":["recursive","r"]},{"Names":["progress"]}]},{"Name":"rm","Subcommands":[],"Options":[{"Names":["recursive","r"]}]},{"Name":"ls","Subcommands":[],"Options":[{"Names":["type","t"]},{"Names":["quiet","q"]}]},{"Name":"verify","Subcommands":[],"Options":[{"Names":["verbose"]},{"Names":["quiet","q"]}]}],"Options":[]},{"Name":"swarm","Subcommands":[{"Name":"addrs","Subcommands":[{"Name":"local","Subcommands":[],"Options":[{"Names":["id"]}]},{"Name":"listen","Subcommands":[],"Options":[]}],"Options":[]},{"Name":"connect","Subcommands":[],"Options":[]},{"Name":"disconnect","Subcommands":[],"Options":[]},{"Name":"filters","Subcommands":[{"Name":"rm","Subcommands":[],"Options":[]},{"Name":"add","Subcommands":[],"Options":[]}],"Options":[]},{"Name":"peers","Subcommands":[],"Options":[{"Names":["verbose","v"]},{"Names":["streams"]},{"Names":["latency"]}]}],"Options":[]}] 10 | * Options : [{"Names":["config","c"]},{"Names":["debug","D"]},{"Names":["help"]},{"Names":["h"]},{"Names":["local","L"]},{"Names":["api"]},{"Names":["encoding","enc"]},{"Names":["stream-channels"]},{"Names":["timeout"]}] 11 | */ 12 | 13 | private String Name; 14 | private List Subcommands; 15 | private List Options; 16 | 17 | public String getName() { 18 | return Name; 19 | } 20 | 21 | public void setName(String Name) { 22 | this.Name = Name; 23 | } 24 | 25 | public List getSubcommands() { 26 | return Subcommands; 27 | } 28 | 29 | public void setSubcommands(List Subcommands) { 30 | this.Subcommands = Subcommands; 31 | } 32 | 33 | public List getOptions() { 34 | return Options; 35 | } 36 | 37 | public void setOptions(List Options) { 38 | this.Options = Options; 39 | } 40 | 41 | public static class SubcommandsBean { 42 | /** 43 | * Name : add 44 | * Subcommands : [] 45 | * Options : [{"Names":["recursive","r"]},{"Names":["quiet","q"]},{"Names":["quieter","Q"]},{"Names":["silent"]},{"Names":["progress","p"]},{"Names":["trickle","t"]},{"Names":["only-hash","n"]},{"Names":["wrap-with-directory","w"]},{"Names":["hidden","H"]},{"Names":["chunker","s"]},{"Names":["pin"]},{"Names":["raw-leaves"]},{"Names":["nocopy"]},{"Names":["fscache"]},{"Names":["cid-version"]},{"Names":["hash"]}] 46 | */ 47 | 48 | private String Name; 49 | private List Subcommands; 50 | private List Options; 51 | 52 | public String getName() { 53 | return Name; 54 | } 55 | 56 | public void setName(String Name) { 57 | this.Name = Name; 58 | } 59 | 60 | public List getSubcommands() { 61 | return Subcommands; 62 | } 63 | 64 | public void setSubcommands(List Subcommands) { 65 | this.Subcommands = Subcommands; 66 | } 67 | 68 | public List getOptions() { 69 | return Options; 70 | } 71 | 72 | public void setOptions(List Options) { 73 | this.Options = Options; 74 | } 75 | 76 | public static class OptionsBean { 77 | private List Names; 78 | 79 | public List getNames() { 80 | return Names; 81 | } 82 | 83 | public void setNames(List Names) { 84 | this.Names = Names; 85 | } 86 | } 87 | } 88 | 89 | public static class OptionsBeanX { 90 | private List Names; 91 | 92 | public List getNames() { 93 | return Names; 94 | } 95 | 96 | public void setNames(List Names) { 97 | this.Names = Names; 98 | } 99 | } 100 | 101 | @Override 102 | public String toString() { 103 | return "Commands{" + 104 | "Name='" + Name + '\'' + 105 | ", Subcommands=" + Subcommands + 106 | ", Options=" + Options + 107 | '}'; 108 | } 109 | } 110 | -------------------------------------------------------------------------------- /library/src/main/java/org/ipfsbox/library/entity/Config.java: -------------------------------------------------------------------------------- 1 | package org.ipfsbox.library.entity; 2 | 3 | import java.util.List; 4 | 5 | public class Config { 6 | public static class show { 7 | 8 | /** 9 | * API : {"HTTPHeaders":{"Access-Control-Allow-Methods":["PUT","GET","POST","OPTIONS"],"Access-Control-Allow-Origin":["*"]}} 10 | * Addresses : {"API":"/ip4/0.0.0.0/tcp/5001","Announce":[],"Gateway":"/ip4/127.0.0.1/tcp/8080","NoAnnounce":[],"Swarm":["/ip4/0.0.0.0/tcp/4001","/ip6/::/tcp/4001"]} 11 | * Bootstrap : ["/dnsaddr/bootstrap.libp2p.io/ipfs/QmNnooDu7bfjPFoTZYxMNLWUQJyrVwtbZg5gBMjTezGAJN","/dnsaddr/bootstrap.libp2p.io/ipfs/QmQCU2EcMqAqQPR2i9bChDtGNJchTbq5TbXJJ16u19uLTa","/dnsaddr/bootstrap.libp2p.io/ipfs/QmbLHAnMoJPWSCR5Zhtx6BHJX9KiKNN6tpvbUcqanj75Nb","/dnsaddr/bootstrap.libp2p.io/ipfs/QmcZf59bWwK5XFi76CZX8cbJ4BhTzzA3gU1ZjYZcYW3dwt","/ip4/104.131.131.82/tcp/4001/ipfs/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ","/ip4/104.236.179.241/tcp/4001/ipfs/QmSoLPppuBtQSGwKDZT2M73ULpjvfd3aZ6ha4oFGL1KrGM","/ip4/128.199.219.111/tcp/4001/ipfs/QmSoLSafTMBsPKadTEgaXctDQVcqN88CNLHXMkTNwMKPnu","/ip4/104.236.76.40/tcp/4001/ipfs/QmSoLV4Bbm51jM9C4gDYZQ9Cy3U6aXMJDAbzgu2fzaDs64","/ip4/178.62.158.247/tcp/4001/ipfs/QmSoLer265NRgSp2LA3dPaeykiS1J6DifTC88f5uVQKNAd","/ip6/2604:a880:1:20::203:d001/tcp/4001/ipfs/QmSoLPppuBtQSGwKDZT2M73ULpjvfd3aZ6ha4oFGL1KrGM","/ip6/2400:6180:0:d0::151:6001/tcp/4001/ipfs/QmSoLSafTMBsPKadTEgaXctDQVcqN88CNLHXMkTNwMKPnu","/ip6/2604:a880:800:10::4a:5001/tcp/4001/ipfs/QmSoLV4Bbm51jM9C4gDYZQ9Cy3U6aXMJDAbzgu2fzaDs64","/ip6/2a03:b0c0:0:1010::23:1001/tcp/4001/ipfs/QmSoLer265NRgSp2LA3dPaeykiS1J6DifTC88f5uVQKNAd"] 12 | * Datastore : {"BloomFilterSize":0,"GCPeriod":"1h","HashOnRead":false,"Spec":{"mounts":[{"child":{"path":"blocks","shardFunc":"/repo/flatfs/shard/v1/next-to-last/2","sync":true,"type":"flatfs"},"mountpoint":"/blocks","prefix":"flatfs.datastore","type":"measure"},{"child":{"compression":"none","path":"datastore","type":"levelds"},"mountpoint":"/","prefix":"leveldb.datastore","type":"measure"}],"type":"mount"},"StorageGCWatermark":90,"StorageMax":"10GB"} 13 | * Discovery : {"MDNS":{"Enabled":true,"Interval":10}} 14 | * Experimental : {"FilestoreEnabled":false,"Libp2pStreamMounting":false,"ShardingEnabled":false} 15 | * Gateway : {"HTTPHeaders":{"Access-Control-Allow-Headers":["X-Requested-With","Range"],"Access-Control-Allow-Methods":["GET"],"Access-Control-Allow-Origin":["*"]},"PathPrefixes":[],"RootRedirect":"","Writable":false} 16 | * Identity : {"PeerID":"Qmc6ixYBnr6t9Er4UhFjjgS5r95K2nMbf3yqNwq56R1Juc"} 17 | * Ipns : {"RecordLifetime":"","RepublishPeriod":"","ResolveCacheSize":128} 18 | * Mounts : {"FuseAllowOther":false,"IPFS":"/ipfs","IPNS":"/ipns"} 19 | * Reprovider : {"Interval":"12h","Strategy":"all"} 20 | * Swarm : {"AddrFilters":null,"ConnMgr":{"GracePeriod":"20s","HighWater":900,"LowWater":600,"Type":"basic"},"DisableBandwidthMetrics":false,"DisableNatPortMap":false,"DisableRelay":false,"EnableRelayHop":false} 21 | */ 22 | 23 | private APIBean API; 24 | private AddressesBean Addresses; 25 | private DatastoreBean Datastore; 26 | private DiscoveryBean Discovery; 27 | private ExperimentalBean Experimental; 28 | private GatewayBean Gateway; 29 | private IdentityBean Identity; 30 | private IpnsBean Ipns; 31 | private MountsBeanX Mounts; 32 | private ReproviderBean Reprovider; 33 | private SwarmBean Swarm; 34 | private List Bootstrap; 35 | 36 | public APIBean getAPI() { 37 | return API; 38 | } 39 | 40 | public void setAPI(APIBean API) { 41 | this.API = API; 42 | } 43 | 44 | public AddressesBean getAddresses() { 45 | return Addresses; 46 | } 47 | 48 | public void setAddresses(AddressesBean Addresses) { 49 | this.Addresses = Addresses; 50 | } 51 | 52 | public DatastoreBean getDatastore() { 53 | return Datastore; 54 | } 55 | 56 | public void setDatastore(DatastoreBean Datastore) { 57 | this.Datastore = Datastore; 58 | } 59 | 60 | public DiscoveryBean getDiscovery() { 61 | return Discovery; 62 | } 63 | 64 | public void setDiscovery(DiscoveryBean Discovery) { 65 | this.Discovery = Discovery; 66 | } 67 | 68 | public ExperimentalBean getExperimental() { 69 | return Experimental; 70 | } 71 | 72 | public void setExperimental(ExperimentalBean Experimental) { 73 | this.Experimental = Experimental; 74 | } 75 | 76 | public GatewayBean getGateway() { 77 | return Gateway; 78 | } 79 | 80 | public void setGateway(GatewayBean Gateway) { 81 | this.Gateway = Gateway; 82 | } 83 | 84 | public IdentityBean getIdentity() { 85 | return Identity; 86 | } 87 | 88 | public void setIdentity(IdentityBean Identity) { 89 | this.Identity = Identity; 90 | } 91 | 92 | public IpnsBean getIpns() { 93 | return Ipns; 94 | } 95 | 96 | public void setIpns(IpnsBean Ipns) { 97 | this.Ipns = Ipns; 98 | } 99 | 100 | public MountsBeanX getMounts() { 101 | return Mounts; 102 | } 103 | 104 | public void setMounts(MountsBeanX Mounts) { 105 | this.Mounts = Mounts; 106 | } 107 | 108 | public ReproviderBean getReprovider() { 109 | return Reprovider; 110 | } 111 | 112 | public void setReprovider(ReproviderBean Reprovider) { 113 | this.Reprovider = Reprovider; 114 | } 115 | 116 | public SwarmBean getSwarm() { 117 | return Swarm; 118 | } 119 | 120 | public void setSwarm(SwarmBean Swarm) { 121 | this.Swarm = Swarm; 122 | } 123 | 124 | public List getBootstrap() { 125 | return Bootstrap; 126 | } 127 | 128 | public void setBootstrap(List Bootstrap) { 129 | this.Bootstrap = Bootstrap; 130 | } 131 | 132 | public static class APIBean { 133 | /** 134 | * HTTPHeaders : {"Access-Control-Allow-Methods":["PUT","GET","POST","OPTIONS"],"Access-Control-Allow-Origin":["*"]} 135 | */ 136 | 137 | private HTTPHeadersBean HTTPHeaders; 138 | 139 | public HTTPHeadersBean getHTTPHeaders() { 140 | return HTTPHeaders; 141 | } 142 | 143 | public void setHTTPHeaders(HTTPHeadersBean HTTPHeaders) { 144 | this.HTTPHeaders = HTTPHeaders; 145 | } 146 | 147 | public static class HTTPHeadersBean { 148 | private List AccessControlAllowMethods; 149 | private List AccessControlAllowOrigin; 150 | 151 | public List getAccessControlAllowMethods() { 152 | return AccessControlAllowMethods; 153 | } 154 | 155 | public void setAccessControlAllowMethods(List AccessControlAllowMethods) { 156 | this.AccessControlAllowMethods = AccessControlAllowMethods; 157 | } 158 | 159 | public List getAccessControlAllowOrigin() { 160 | return AccessControlAllowOrigin; 161 | } 162 | 163 | public void setAccessControlAllowOrigin(List AccessControlAllowOrigin) { 164 | this.AccessControlAllowOrigin = AccessControlAllowOrigin; 165 | } 166 | } 167 | } 168 | 169 | public static class AddressesBean { 170 | /** 171 | * API : /ip4/0.0.0.0/tcp/5001 172 | * Announce : [] 173 | * Gateway : /ip4/127.0.0.1/tcp/8080 174 | * NoAnnounce : [] 175 | * Swarm : ["/ip4/0.0.0.0/tcp/4001","/ip6/::/tcp/4001"] 176 | */ 177 | 178 | private String API; 179 | private String Gateway; 180 | private List Announce; 181 | private List NoAnnounce; 182 | private List Swarm; 183 | 184 | public String getAPI() { 185 | return API; 186 | } 187 | 188 | public void setAPI(String API) { 189 | this.API = API; 190 | } 191 | 192 | public String getGateway() { 193 | return Gateway; 194 | } 195 | 196 | public void setGateway(String Gateway) { 197 | this.Gateway = Gateway; 198 | } 199 | 200 | public List getAnnounce() { 201 | return Announce; 202 | } 203 | 204 | public void setAnnounce(List Announce) { 205 | this.Announce = Announce; 206 | } 207 | 208 | public List getNoAnnounce() { 209 | return NoAnnounce; 210 | } 211 | 212 | public void setNoAnnounce(List NoAnnounce) { 213 | this.NoAnnounce = NoAnnounce; 214 | } 215 | 216 | public List getSwarm() { 217 | return Swarm; 218 | } 219 | 220 | public void setSwarm(List Swarm) { 221 | this.Swarm = Swarm; 222 | } 223 | } 224 | 225 | public static class DatastoreBean { 226 | /** 227 | * BloomFilterSize : 0 228 | * GCPeriod : 1h 229 | * HashOnRead : false 230 | * Spec : {"mounts":[{"child":{"path":"blocks","shardFunc":"/repo/flatfs/shard/v1/next-to-last/2","sync":true,"type":"flatfs"},"mountpoint":"/blocks","prefix":"flatfs.datastore","type":"measure"},{"child":{"compression":"none","path":"datastore","type":"levelds"},"mountpoint":"/","prefix":"leveldb.datastore","type":"measure"}],"type":"mount"} 231 | * StorageGCWatermark : 90 232 | * StorageMax : 10GB 233 | */ 234 | 235 | private int BloomFilterSize; 236 | private String GCPeriod; 237 | private boolean HashOnRead; 238 | private SpecBean Spec; 239 | private int StorageGCWatermark; 240 | private String StorageMax; 241 | 242 | public int getBloomFilterSize() { 243 | return BloomFilterSize; 244 | } 245 | 246 | public void setBloomFilterSize(int BloomFilterSize) { 247 | this.BloomFilterSize = BloomFilterSize; 248 | } 249 | 250 | public String getGCPeriod() { 251 | return GCPeriod; 252 | } 253 | 254 | public void setGCPeriod(String GCPeriod) { 255 | this.GCPeriod = GCPeriod; 256 | } 257 | 258 | public boolean isHashOnRead() { 259 | return HashOnRead; 260 | } 261 | 262 | public void setHashOnRead(boolean HashOnRead) { 263 | this.HashOnRead = HashOnRead; 264 | } 265 | 266 | public SpecBean getSpec() { 267 | return Spec; 268 | } 269 | 270 | public void setSpec(SpecBean Spec) { 271 | this.Spec = Spec; 272 | } 273 | 274 | public int getStorageGCWatermark() { 275 | return StorageGCWatermark; 276 | } 277 | 278 | public void setStorageGCWatermark(int StorageGCWatermark) { 279 | this.StorageGCWatermark = StorageGCWatermark; 280 | } 281 | 282 | public String getStorageMax() { 283 | return StorageMax; 284 | } 285 | 286 | public void setStorageMax(String StorageMax) { 287 | this.StorageMax = StorageMax; 288 | } 289 | 290 | public static class SpecBean { 291 | /** 292 | * mounts : [{"child":{"path":"blocks","shardFunc":"/repo/flatfs/shard/v1/next-to-last/2","sync":true,"type":"flatfs"},"mountpoint":"/blocks","prefix":"flatfs.datastore","type":"measure"},{"child":{"compression":"none","path":"datastore","type":"levelds"},"mountpoint":"/","prefix":"leveldb.datastore","type":"measure"}] 293 | * type : mount 294 | */ 295 | 296 | private String type; 297 | private List mounts; 298 | 299 | public String getType() { 300 | return type; 301 | } 302 | 303 | public void setType(String type) { 304 | this.type = type; 305 | } 306 | 307 | public List getMounts() { 308 | return mounts; 309 | } 310 | 311 | public void setMounts(List mounts) { 312 | this.mounts = mounts; 313 | } 314 | 315 | public static class MountsBean { 316 | /** 317 | * child : {"path":"blocks","shardFunc":"/repo/flatfs/shard/v1/next-to-last/2","sync":true,"type":"flatfs"} 318 | * mountpoint : /blocks 319 | * prefix : flatfs.datastore 320 | * type : measure 321 | */ 322 | 323 | private ChildBean child; 324 | private String mountpoint; 325 | private String prefix; 326 | private String type; 327 | 328 | public ChildBean getChild() { 329 | return child; 330 | } 331 | 332 | public void setChild(ChildBean child) { 333 | this.child = child; 334 | } 335 | 336 | public String getMountpoint() { 337 | return mountpoint; 338 | } 339 | 340 | public void setMountpoint(String mountpoint) { 341 | this.mountpoint = mountpoint; 342 | } 343 | 344 | public String getPrefix() { 345 | return prefix; 346 | } 347 | 348 | public void setPrefix(String prefix) { 349 | this.prefix = prefix; 350 | } 351 | 352 | public String getType() { 353 | return type; 354 | } 355 | 356 | public void setType(String type) { 357 | this.type = type; 358 | } 359 | 360 | public static class ChildBean { 361 | /** 362 | * path : blocks 363 | * shardFunc : /repo/flatfs/shard/v1/next-to-last/2 364 | * sync : true 365 | * type : flatfs 366 | */ 367 | 368 | private String path; 369 | private String shardFunc; 370 | private boolean sync; 371 | private String type; 372 | 373 | public String getPath() { 374 | return path; 375 | } 376 | 377 | public void setPath(String path) { 378 | this.path = path; 379 | } 380 | 381 | public String getShardFunc() { 382 | return shardFunc; 383 | } 384 | 385 | public void setShardFunc(String shardFunc) { 386 | this.shardFunc = shardFunc; 387 | } 388 | 389 | public boolean isSync() { 390 | return sync; 391 | } 392 | 393 | public void setSync(boolean sync) { 394 | this.sync = sync; 395 | } 396 | 397 | public String getType() { 398 | return type; 399 | } 400 | 401 | public void setType(String type) { 402 | this.type = type; 403 | } 404 | } 405 | } 406 | } 407 | } 408 | 409 | public static class DiscoveryBean { 410 | /** 411 | * MDNS : {"Enabled":true,"Interval":10} 412 | */ 413 | 414 | private MDNSBean MDNS; 415 | 416 | public MDNSBean getMDNS() { 417 | return MDNS; 418 | } 419 | 420 | public void setMDNS(MDNSBean MDNS) { 421 | this.MDNS = MDNS; 422 | } 423 | 424 | public static class MDNSBean { 425 | /** 426 | * Enabled : true 427 | * Interval : 10 428 | */ 429 | 430 | private boolean Enabled; 431 | private int Interval; 432 | 433 | public boolean isEnabled() { 434 | return Enabled; 435 | } 436 | 437 | public void setEnabled(boolean Enabled) { 438 | this.Enabled = Enabled; 439 | } 440 | 441 | public int getInterval() { 442 | return Interval; 443 | } 444 | 445 | public void setInterval(int Interval) { 446 | this.Interval = Interval; 447 | } 448 | } 449 | } 450 | 451 | public static class ExperimentalBean { 452 | /** 453 | * FilestoreEnabled : false 454 | * Libp2pStreamMounting : false 455 | * ShardingEnabled : false 456 | */ 457 | 458 | private boolean FilestoreEnabled; 459 | private boolean Libp2pStreamMounting; 460 | private boolean ShardingEnabled; 461 | 462 | public boolean isFilestoreEnabled() { 463 | return FilestoreEnabled; 464 | } 465 | 466 | public void setFilestoreEnabled(boolean FilestoreEnabled) { 467 | this.FilestoreEnabled = FilestoreEnabled; 468 | } 469 | 470 | public boolean isLibp2pStreamMounting() { 471 | return Libp2pStreamMounting; 472 | } 473 | 474 | public void setLibp2pStreamMounting(boolean Libp2pStreamMounting) { 475 | this.Libp2pStreamMounting = Libp2pStreamMounting; 476 | } 477 | 478 | public boolean isShardingEnabled() { 479 | return ShardingEnabled; 480 | } 481 | 482 | public void setShardingEnabled(boolean ShardingEnabled) { 483 | this.ShardingEnabled = ShardingEnabled; 484 | } 485 | } 486 | 487 | public static class GatewayBean { 488 | /** 489 | * HTTPHeaders : {"Access-Control-Allow-Headers":["X-Requested-With","Range"],"Access-Control-Allow-Methods":["GET"],"Access-Control-Allow-Origin":["*"]} 490 | * PathPrefixes : [] 491 | * RootRedirect : 492 | * Writable : false 493 | */ 494 | 495 | private HTTPHeadersBeanX HTTPHeaders; 496 | private String RootRedirect; 497 | private boolean Writable; 498 | private List PathPrefixes; 499 | 500 | public HTTPHeadersBeanX getHTTPHeaders() { 501 | return HTTPHeaders; 502 | } 503 | 504 | public void setHTTPHeaders(HTTPHeadersBeanX HTTPHeaders) { 505 | this.HTTPHeaders = HTTPHeaders; 506 | } 507 | 508 | public String getRootRedirect() { 509 | return RootRedirect; 510 | } 511 | 512 | public void setRootRedirect(String RootRedirect) { 513 | this.RootRedirect = RootRedirect; 514 | } 515 | 516 | public boolean isWritable() { 517 | return Writable; 518 | } 519 | 520 | public void setWritable(boolean Writable) { 521 | this.Writable = Writable; 522 | } 523 | 524 | public List getPathPrefixes() { 525 | return PathPrefixes; 526 | } 527 | 528 | public void setPathPrefixes(List PathPrefixes) { 529 | this.PathPrefixes = PathPrefixes; 530 | } 531 | 532 | public static class HTTPHeadersBeanX { 533 | private List AccessControlAllowHeaders; 534 | private List AccessControlAllowMethods; 535 | private List AccessControlAllowOrigin; 536 | 537 | public List getAccessControlAllowHeaders() { 538 | return AccessControlAllowHeaders; 539 | } 540 | 541 | public void setAccessControlAllowHeaders(List AccessControlAllowHeaders) { 542 | this.AccessControlAllowHeaders = AccessControlAllowHeaders; 543 | } 544 | 545 | public List getAccessControlAllowMethods() { 546 | return AccessControlAllowMethods; 547 | } 548 | 549 | public void setAccessControlAllowMethods(List AccessControlAllowMethods) { 550 | this.AccessControlAllowMethods = AccessControlAllowMethods; 551 | } 552 | 553 | public List getAccessControlAllowOrigin() { 554 | return AccessControlAllowOrigin; 555 | } 556 | 557 | public void setAccessControlAllowOrigin(List AccessControlAllowOrigin) { 558 | this.AccessControlAllowOrigin = AccessControlAllowOrigin; 559 | } 560 | } 561 | } 562 | 563 | public static class IdentityBean { 564 | /** 565 | * PeerID : Qmc6ixYBnr6t9Er4UhFjjgS5r95K2nMbf3yqNwq56R1Juc 566 | */ 567 | 568 | private String PeerID; 569 | 570 | public String getPeerID() { 571 | return PeerID; 572 | } 573 | 574 | public void setPeerID(String PeerID) { 575 | this.PeerID = PeerID; 576 | } 577 | } 578 | 579 | public static class IpnsBean { 580 | /** 581 | * RecordLifetime : 582 | * RepublishPeriod : 583 | * ResolveCacheSize : 128 584 | */ 585 | 586 | private String RecordLifetime; 587 | private String RepublishPeriod; 588 | private int ResolveCacheSize; 589 | 590 | public String getRecordLifetime() { 591 | return RecordLifetime; 592 | } 593 | 594 | public void setRecordLifetime(String RecordLifetime) { 595 | this.RecordLifetime = RecordLifetime; 596 | } 597 | 598 | public String getRepublishPeriod() { 599 | return RepublishPeriod; 600 | } 601 | 602 | public void setRepublishPeriod(String RepublishPeriod) { 603 | this.RepublishPeriod = RepublishPeriod; 604 | } 605 | 606 | public int getResolveCacheSize() { 607 | return ResolveCacheSize; 608 | } 609 | 610 | public void setResolveCacheSize(int ResolveCacheSize) { 611 | this.ResolveCacheSize = ResolveCacheSize; 612 | } 613 | } 614 | 615 | public static class MountsBeanX { 616 | /** 617 | * FuseAllowOther : false 618 | * IPFS : /ipfs 619 | * IPNS : /ipns 620 | */ 621 | 622 | private boolean FuseAllowOther; 623 | private String IPFS; 624 | private String IPNS; 625 | 626 | public boolean isFuseAllowOther() { 627 | return FuseAllowOther; 628 | } 629 | 630 | public void setFuseAllowOther(boolean FuseAllowOther) { 631 | this.FuseAllowOther = FuseAllowOther; 632 | } 633 | 634 | public String getIPFS() { 635 | return IPFS; 636 | } 637 | 638 | public void setIPFS(String IPFS) { 639 | this.IPFS = IPFS; 640 | } 641 | 642 | public String getIPNS() { 643 | return IPNS; 644 | } 645 | 646 | public void setIPNS(String IPNS) { 647 | this.IPNS = IPNS; 648 | } 649 | } 650 | 651 | public static class ReproviderBean { 652 | /** 653 | * Interval : 12h 654 | * Strategy : all 655 | */ 656 | 657 | private String Interval; 658 | private String Strategy; 659 | 660 | public String getInterval() { 661 | return Interval; 662 | } 663 | 664 | public void setInterval(String Interval) { 665 | this.Interval = Interval; 666 | } 667 | 668 | public String getStrategy() { 669 | return Strategy; 670 | } 671 | 672 | public void setStrategy(String Strategy) { 673 | this.Strategy = Strategy; 674 | } 675 | } 676 | 677 | public static class SwarmBean { 678 | /** 679 | * AddrFilters : null 680 | * ConnMgr : {"GracePeriod":"20s","HighWater":900,"LowWater":600,"Type":"basic"} 681 | * DisableBandwidthMetrics : false 682 | * DisableNatPortMap : false 683 | * DisableRelay : false 684 | * EnableRelayHop : false 685 | */ 686 | 687 | private Object AddrFilters; 688 | private ConnMgrBean ConnMgr; 689 | private boolean DisableBandwidthMetrics; 690 | private boolean DisableNatPortMap; 691 | private boolean DisableRelay; 692 | private boolean EnableRelayHop; 693 | 694 | public Object getAddrFilters() { 695 | return AddrFilters; 696 | } 697 | 698 | public void setAddrFilters(Object AddrFilters) { 699 | this.AddrFilters = AddrFilters; 700 | } 701 | 702 | public ConnMgrBean getConnMgr() { 703 | return ConnMgr; 704 | } 705 | 706 | public void setConnMgr(ConnMgrBean ConnMgr) { 707 | this.ConnMgr = ConnMgr; 708 | } 709 | 710 | public boolean isDisableBandwidthMetrics() { 711 | return DisableBandwidthMetrics; 712 | } 713 | 714 | public void setDisableBandwidthMetrics(boolean DisableBandwidthMetrics) { 715 | this.DisableBandwidthMetrics = DisableBandwidthMetrics; 716 | } 717 | 718 | public boolean isDisableNatPortMap() { 719 | return DisableNatPortMap; 720 | } 721 | 722 | public void setDisableNatPortMap(boolean DisableNatPortMap) { 723 | this.DisableNatPortMap = DisableNatPortMap; 724 | } 725 | 726 | public boolean isDisableRelay() { 727 | return DisableRelay; 728 | } 729 | 730 | public void setDisableRelay(boolean DisableRelay) { 731 | this.DisableRelay = DisableRelay; 732 | } 733 | 734 | public boolean isEnableRelayHop() { 735 | return EnableRelayHop; 736 | } 737 | 738 | public void setEnableRelayHop(boolean EnableRelayHop) { 739 | this.EnableRelayHop = EnableRelayHop; 740 | } 741 | 742 | public static class ConnMgrBean { 743 | /** 744 | * GracePeriod : 20s 745 | * HighWater : 900 746 | * LowWater : 600 747 | * Type : basic 748 | */ 749 | 750 | private String GracePeriod; 751 | private int HighWater; 752 | private int LowWater; 753 | private String Type; 754 | 755 | public String getGracePeriod() { 756 | return GracePeriod; 757 | } 758 | 759 | public void setGracePeriod(String GracePeriod) { 760 | this.GracePeriod = GracePeriod; 761 | } 762 | 763 | public int getHighWater() { 764 | return HighWater; 765 | } 766 | 767 | public void setHighWater(int HighWater) { 768 | this.HighWater = HighWater; 769 | } 770 | 771 | public int getLowWater() { 772 | return LowWater; 773 | } 774 | 775 | public void setLowWater(int LowWater) { 776 | this.LowWater = LowWater; 777 | } 778 | 779 | public String getType() { 780 | return Type; 781 | } 782 | 783 | public void setType(String Type) { 784 | this.Type = Type; 785 | } 786 | } 787 | } 788 | } 789 | } 790 | -------------------------------------------------------------------------------- /library/src/main/java/org/ipfsbox/library/entity/Dag.java: -------------------------------------------------------------------------------- 1 | package org.ipfsbox.library.entity; 2 | 3 | import java.util.List; 4 | 5 | public class Dag { 6 | public static class get { 7 | 8 | /** 9 | * data : CAIYzLo1IICAECCAgBAggIAQIMy6BQ== 10 | * links : [{"Name":"","Size":262158,"Cid":{"/":"Qmb4xjbfGxf7t7XTGgHq7oraqq5FPmAKeahNegmRqLJDLR"}},{"Name":"","Size":262158,"Cid":{"/":"QmRxfkUGHGeRMmq9UaChZqYbGQJmxKvewVvAYhWPX5BC1t"}},{"Name":"","Size":262158,"Cid":{"/":"QmRJWy1i4339AnBtfP6r8PymHdp7N35g4JnyC4wQZt76EF"}},{"Name":"","Size":89434,"Cid":{"/":"QmVwajgYQ6ZMNBSshNep72q47CtB9e8F7LATV95HQpUcdE"}}] 11 | */ 12 | 13 | private String data; 14 | private List links; 15 | 16 | public String getData() { 17 | return data; 18 | } 19 | 20 | public void setData(String data) { 21 | this.data = data; 22 | } 23 | 24 | public List getLinks() { 25 | return links; 26 | } 27 | 28 | public void setLinks(List links) { 29 | this.links = links; 30 | } 31 | 32 | public static class LinksBean { 33 | /** 34 | * Name : 35 | * Size : 262158 36 | * Cid : {"/":"Qmb4xjbfGxf7t7XTGgHq7oraqq5FPmAKeahNegmRqLJDLR"} 37 | */ 38 | 39 | private String Name; 40 | private int Size; 41 | private CidBean Cid; 42 | 43 | public String getName() { 44 | return Name; 45 | } 46 | 47 | public void setName(String Name) { 48 | this.Name = Name; 49 | } 50 | 51 | public int getSize() { 52 | return Size; 53 | } 54 | 55 | public void setSize(int Size) { 56 | this.Size = Size; 57 | } 58 | 59 | public CidBean getCid() { 60 | return Cid; 61 | } 62 | 63 | public void setCid(CidBean Cid) { 64 | this.Cid = Cid; 65 | } 66 | 67 | public static class CidBean { 68 | private String _$229; // FIXME check this code 69 | 70 | public String get_$229() { 71 | return _$229; 72 | } 73 | 74 | public void set_$229(String _$229) { 75 | this._$229 = _$229; 76 | } 77 | } 78 | } 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /library/src/main/java/org/ipfsbox/library/entity/Id.java: -------------------------------------------------------------------------------- 1 | package org.ipfsbox.library.entity; 2 | 3 | import java.util.List; 4 | 5 | public class Id { 6 | 7 | /** 8 | * ID : Qmc6ixYBnr6t9Er4UhFjjgS5r95K2nMbf3yqNwq56R1Juc 9 | * PublicKey : CAASpgIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCf1o2zB2X6gTIQyQxat36UDjSkDSD6/wxyl+euU13r94mGOp5/lMO2j54sC7iMa/NICskhCPa69H/f55iQ60rs666iDuxyVE903KxPqDIGcuztIKrj0UBSmRPxfl67BKhjnApdTQTTM7Ou0h2JmZSoh1Znf96ibjK/hH6BXUKIyno7xnpP/RA46JqHmpDaYqt/5QzpflfHo/i+xTMsW4ZZnrk/zN6i1aDFoNeR4uk6JjxlSpZBFwDEr6qUQ8Ia3fVxFqvgLhi3D3msXOY8dxwSJUEmu1de/dDD1maHdJJOsAfsDh0h8Y//kE4pGbDVOBRWpzXmZ3VmGcZZ2fIqH9bfAgMBAAE= 10 | * Addresses : ["/ip6/::1/tcp/4001/ipfs/Qmc6ixYBnr6t9Er4UhFjjgS5r95K2nMbf3yqNwq56R1Juc","/ip4/127.0.0.1/tcp/4001/ipfs/Qmc6ixYBnr6t9Er4UhFjjgS5r95K2nMbf3yqNwq56R1Juc","/ip4/192.168.20.123/tcp/4001/ipfs/Qmc6ixYBnr6t9Er4UhFjjgS5r95K2nMbf3yqNwq56R1Juc","/ip4/192.168.57.1/tcp/4001/ipfs/Qmc6ixYBnr6t9Er4UhFjjgS5r95K2nMbf3yqNwq56R1Juc","/ip4/180.169.128.154/tcp/4001/ipfs/Qmc6ixYBnr6t9Er4UhFjjgS5r95K2nMbf3yqNwq56R1Juc"] 11 | * AgentVersion : go-ipfs/0.4.14/ 12 | * ProtocolVersion : ipfs/0.1.0 13 | */ 14 | 15 | private String ID; 16 | private String PublicKey; 17 | private String AgentVersion; 18 | private String ProtocolVersion; 19 | private List Addresses; 20 | 21 | public String getID() { 22 | return ID; 23 | } 24 | 25 | public void setID(String ID) { 26 | this.ID = ID; 27 | } 28 | 29 | public String getPublicKey() { 30 | return PublicKey; 31 | } 32 | 33 | public void setPublicKey(String PublicKey) { 34 | this.PublicKey = PublicKey; 35 | } 36 | 37 | public String getAgentVersion() { 38 | return AgentVersion; 39 | } 40 | 41 | public void setAgentVersion(String AgentVersion) { 42 | this.AgentVersion = AgentVersion; 43 | } 44 | 45 | public String getProtocolVersion() { 46 | return ProtocolVersion; 47 | } 48 | 49 | public void setProtocolVersion(String ProtocolVersion) { 50 | this.ProtocolVersion = ProtocolVersion; 51 | } 52 | 53 | @Override 54 | public String toString() { 55 | return "Id{" + 56 | "ID='" + ID + '\'' + 57 | ", PublicKey='" + PublicKey + '\'' + 58 | ", AgentVersion='" + AgentVersion + '\'' + 59 | ", ProtocolVersion='" + ProtocolVersion + '\'' + 60 | ", Addresses=" + Addresses + 61 | '}'; 62 | } 63 | 64 | public List getAddresses() { 65 | return Addresses; 66 | } 67 | 68 | public void setAddresses(List Addresses) { 69 | this.Addresses = Addresses; 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /library/src/main/java/org/ipfsbox/library/entity/Stats_bw.java: -------------------------------------------------------------------------------- 1 | package org.ipfsbox.library.entity; 2 | 3 | public class Stats_bw { 4 | 5 | /** 6 | * TotalIn : 778463996 7 | * TotalOut : 363485671 8 | * RateIn : 623590.5376857836 9 | * RateOut : 64921.958962250166 10 | */ 11 | 12 | private int TotalIn; 13 | private int TotalOut; 14 | private double RateIn; 15 | private double RateOut; 16 | 17 | public int getTotalIn() { 18 | return TotalIn; 19 | } 20 | 21 | public void setTotalIn(int TotalIn) { 22 | this.TotalIn = TotalIn; 23 | } 24 | 25 | public int getTotalOut() { 26 | return TotalOut; 27 | } 28 | 29 | public void setTotalOut(int TotalOut) { 30 | this.TotalOut = TotalOut; 31 | } 32 | 33 | public double getRateIn() { 34 | return RateIn; 35 | } 36 | 37 | public void setRateIn(double RateIn) { 38 | this.RateIn = RateIn; 39 | } 40 | 41 | public double getRateOut() { 42 | return RateOut; 43 | } 44 | 45 | public void setRateOut(double RateOut) { 46 | this.RateOut = RateOut; 47 | } 48 | 49 | @Override 50 | public String toString() { 51 | return "bw{" + 52 | "TotalIn=" + TotalIn + 53 | ", TotalOut=" + TotalOut + 54 | ", RateIn=" + RateIn + 55 | ", RateOut=" + RateOut + 56 | '}'; 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /library/src/main/java/org/ipfsbox/library/entity/Swarm.java: -------------------------------------------------------------------------------- 1 | package org.ipfsbox.library.entity; 2 | 3 | import java.util.List; 4 | 5 | public class Swarm { 6 | public class connect { 7 | 8 | private List Strings; 9 | 10 | public List getStrings() { 11 | return Strings; 12 | } 13 | 14 | public void setStrings(List Strings) { 15 | this.Strings = Strings; 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /library/src/main/java/org/ipfsbox/library/entity/Version.java: -------------------------------------------------------------------------------- 1 | package org.ipfsbox.library.entity; 2 | 3 | public class Version { 4 | /** 5 | * Version : 0.4.14 6 | * Commit : 7 | * Repo : 6 8 | * System : amd64/darwin 9 | * Golang : go1.10 10 | */ 11 | 12 | private String Version; 13 | private String Commit; 14 | private String Repo; 15 | private String System; 16 | private String Golang; 17 | 18 | public String getVersion() { 19 | return Version; 20 | } 21 | 22 | public void setVersion(String Version) { 23 | this.Version = Version; 24 | } 25 | 26 | public String getCommit() { 27 | return Commit; 28 | } 29 | 30 | public void setCommit(String Commit) { 31 | this.Commit = Commit; 32 | } 33 | 34 | public String getRepo() { 35 | return Repo; 36 | } 37 | 38 | public void setRepo(String Repo) { 39 | this.Repo = Repo; 40 | } 41 | 42 | public String getSystem() { 43 | return System; 44 | } 45 | 46 | public void setSystem(String System) { 47 | this.System = System; 48 | } 49 | 50 | public String getGolang() { 51 | return Golang; 52 | } 53 | 54 | public void setGolang(String Golang) { 55 | this.Golang = Golang; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /library/src/main/java/org/ipfsbox/library/service/CommandService.java: -------------------------------------------------------------------------------- 1 | package org.ipfsbox.library.service; 2 | 3 | import org.ipfsbox.library.entity.Add; 4 | import org.ipfsbox.library.entity.Bitswap_stat; 5 | import org.ipfsbox.library.entity.Commands; 6 | import org.ipfsbox.library.entity.Config; 7 | import org.ipfsbox.library.entity.Dag; 8 | import org.ipfsbox.library.entity.Id; 9 | import org.ipfsbox.library.entity.Stats_bw; 10 | import org.ipfsbox.library.entity.Swarm; 11 | import org.ipfsbox.library.entity.Version; 12 | 13 | import okhttp3.MultipartBody; 14 | import retrofit2.Call; 15 | import retrofit2.http.GET; 16 | import retrofit2.http.Multipart; 17 | import retrofit2.http.POST; 18 | import retrofit2.http.Part; 19 | import retrofit2.http.Path; 20 | import retrofit2.http.Query; 21 | 22 | public interface CommandService { 23 | @POST("add") 24 | @Multipart 25 | Call add(@Part MultipartBody.Part part); 26 | 27 | @GET("version") 28 | Call version(); 29 | 30 | @GET("id") 31 | Call id(); 32 | 33 | @GET("commands") 34 | Call commands(); 35 | 36 | interface pin { 37 | @GET("Pin/ls?type={type}") 38 | Call ls(@Path("type") String type); 39 | } 40 | 41 | interface stats { 42 | @GET("stats/bw") 43 | Call bw(); 44 | } 45 | 46 | interface swarm { 47 | @GET("stats/bw") 48 | Call connect(@Query("arg") String arg); 49 | } 50 | 51 | interface config { 52 | @GET("config/show") 53 | Call show(); 54 | } 55 | 56 | interface dag { 57 | @GET("dag/get") 58 | Call get(@Query("arg") String arg); 59 | } 60 | 61 | interface bitswap { 62 | @GET("bitswap/stat") 63 | Call stat(); 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /library/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | Library 3 | 4 | -------------------------------------------------------------------------------- /library/src/test/java/org/ipfsbox/library/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package org.ipfsbox.library; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * @see Testing documentation 11 | */ 12 | public class ExampleUnitTest { 13 | @Test 14 | public void addition_isCorrect() { 15 | assertEquals(4, 2 + 2); 16 | } 17 | } -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app','library' 2 | --------------------------------------------------------------------------------