Search in sources :

Example 6 with FileWithMetadata

use of com.ibm.cloud.sdk.core.service.model.FileWithMetadata in project java-sdk by watson-developer-cloud.

the class TestUtilities method creatMockListFileWithMetadata.

public static List<FileWithMetadata> creatMockListFileWithMetadata() {
    List<FileWithMetadata> list = new ArrayList<FileWithMetadata>();
    byte[] fileBytes = { (byte) 0xde, (byte) 0xad, (byte) 0xbe, (byte) 0xef };
    InputStream inputStream = new ByteArrayInputStream(fileBytes);
    FileWithMetadata.Builder builder = new FileWithMetadata.Builder();
    builder.data(inputStream);
    FileWithMetadata fileWithMetadata = builder.build();
    list.add(fileWithMetadata);
    return list;
}
Also used : ByteArrayInputStream(java.io.ByteArrayInputStream) ByteArrayInputStream(java.io.ByteArrayInputStream) InputStream(java.io.InputStream) ArrayList(java.util.ArrayList) FileWithMetadata(com.ibm.cloud.sdk.core.service.model.FileWithMetadata)

Example 7 with FileWithMetadata

use of com.ibm.cloud.sdk.core.service.model.FileWithMetadata in project java-sdk by watson-developer-cloud.

the class TestUtilities method creatMockListFileWithMetadata.

public static List<FileWithMetadata> creatMockListFileWithMetadata() {
    List<FileWithMetadata> list = new ArrayList<FileWithMetadata>();
    byte[] fileBytes = { (byte) 0xde, (byte) 0xad, (byte) 0xbe, (byte) 0xef };
    InputStream inputStream = new ByteArrayInputStream(fileBytes);
    FileWithMetadata.Builder builder = new FileWithMetadata.Builder();
    builder.data(inputStream);
    FileWithMetadata fileWithMetadata = builder.build();
    list.add(fileWithMetadata);
    return list;
}
Also used : ByteArrayInputStream(java.io.ByteArrayInputStream) ByteArrayInputStream(java.io.ByteArrayInputStream) InputStream(java.io.InputStream) ArrayList(java.util.ArrayList) FileWithMetadata(com.ibm.cloud.sdk.core.service.model.FileWithMetadata)

Example 8 with FileWithMetadata

use of com.ibm.cloud.sdk.core.service.model.FileWithMetadata in project java-sdk by watson-developer-cloud.

the class TestUtilities method creatMockListFileWithMetadata.

public static List<FileWithMetadata> creatMockListFileWithMetadata() {
    List<FileWithMetadata> list = new ArrayList<FileWithMetadata>();
    byte[] fileBytes = { (byte) 0xde, (byte) 0xad, (byte) 0xbe, (byte) 0xef };
    InputStream inputStream = new ByteArrayInputStream(fileBytes);
    FileWithMetadata.Builder builder = new FileWithMetadata.Builder();
    builder.data(inputStream);
    FileWithMetadata fileWithMetadata = builder.build();
    list.add(fileWithMetadata);
    return list;
}
Also used : ByteArrayInputStream(java.io.ByteArrayInputStream) ByteArrayInputStream(java.io.ByteArrayInputStream) InputStream(java.io.InputStream) ArrayList(java.util.ArrayList) FileWithMetadata(com.ibm.cloud.sdk.core.service.model.FileWithMetadata)

Example 9 with FileWithMetadata

use of com.ibm.cloud.sdk.core.service.model.FileWithMetadata in project java-sdk by watson-developer-cloud.

the class TestUtilities method creatMockListFileWithMetadata.

public static List<FileWithMetadata> creatMockListFileWithMetadata() {
    List<FileWithMetadata> list = new ArrayList<FileWithMetadata>();
    byte[] fileBytes = { (byte) 0xde, (byte) 0xad, (byte) 0xbe, (byte) 0xef };
    InputStream inputStream = new ByteArrayInputStream(fileBytes);
    FileWithMetadata.Builder builder = new FileWithMetadata.Builder();
    builder.data(inputStream);
    FileWithMetadata fileWithMetadata = builder.build();
    list.add(fileWithMetadata);
    return list;
}
Also used : ByteArrayInputStream(java.io.ByteArrayInputStream) ByteArrayInputStream(java.io.ByteArrayInputStream) InputStream(java.io.InputStream) ArrayList(java.util.ArrayList) FileWithMetadata(com.ibm.cloud.sdk.core.service.model.FileWithMetadata)

Example 10 with FileWithMetadata

use of com.ibm.cloud.sdk.core.service.model.FileWithMetadata in project java-sdk by watson-developer-cloud.

the class TestUtilities method creatMockListFileWithMetadata.

public static List<FileWithMetadata> creatMockListFileWithMetadata() {
    List<FileWithMetadata> list = new ArrayList<FileWithMetadata>();
    byte[] fileBytes = { (byte) 0xde, (byte) 0xad, (byte) 0xbe, (byte) 0xef };
    InputStream inputStream = new ByteArrayInputStream(fileBytes);
    FileWithMetadata.Builder builder = new FileWithMetadata.Builder();
    builder.data(inputStream);
    FileWithMetadata fileWithMetadata = builder.build();
    list.add(fileWithMetadata);
    return list;
}
Also used : ByteArrayInputStream(java.io.ByteArrayInputStream) ByteArrayInputStream(java.io.ByteArrayInputStream) InputStream(java.io.InputStream) ArrayList(java.util.ArrayList) FileWithMetadata(com.ibm.cloud.sdk.core.service.model.FileWithMetadata)

Aggregations

FileWithMetadata (com.ibm.cloud.sdk.core.service.model.FileWithMetadata)21 InputStream (java.io.InputStream)17 ByteArrayInputStream (java.io.ByteArrayInputStream)16 ArrayList (java.util.ArrayList)16 WatsonServiceTest (com.ibm.watson.common.WatsonServiceTest)3 ImageDetailsList (com.ibm.watson.visual_recognition.v4.model.ImageDetailsList)3 File (java.io.File)3 Test (org.junit.Test)3 RequestBuilder (com.ibm.cloud.sdk.core.http.RequestBuilder)2 AddImagesOptions (com.ibm.watson.visual_recognition.v4.model.AddImagesOptions)2 AnalyzeResponse (com.ibm.watson.visual_recognition.v4.model.AnalyzeResponse)2 DeleteImageOptions (com.ibm.watson.visual_recognition.v4.model.DeleteImageOptions)2 ImageDetails (com.ibm.watson.visual_recognition.v4.model.ImageDetails)2 MultipartBody (okhttp3.MultipartBody)2 AddImageTrainingDataOptions (com.ibm.watson.visual_recognition.v4.model.AddImageTrainingDataOptions)1 AnalyzeOptions (com.ibm.watson.visual_recognition.v4.model.AnalyzeOptions)1 Collection (com.ibm.watson.visual_recognition.v4.model.Collection)1 GetImageDetailsOptions (com.ibm.watson.visual_recognition.v4.model.GetImageDetailsOptions)1 GetJpegImageOptions (com.ibm.watson.visual_recognition.v4.model.GetJpegImageOptions)1 ImageSummary (com.ibm.watson.visual_recognition.v4.model.ImageSummary)1