-
Notifications
You must be signed in to change notification settings - Fork 21
Open
Description
i tried this code in my app but getting an error in android studio about the package in code
PandorabotsAPI.java file
import java.nio.File;
import java.nio.file.Paths;
import java.nio.File;
import java.nio.file.Paths;
/**
* Upload a file.
*
* @param botName
* name of bot
* @param pathName
* path for upload file
* @return status of response
* @throws IOException
* @throws ClientProtocolException
* @throws URISyntaxException
* @since 0.0.1
*/
public String uploadFile(String botName, String pathName)
throws ClientProtocolException, IOException, URISyntaxException {
URI uri = fileUri(botName, pathName);
Log("Upload botName=" + botName + " pathName=" + pathName + " uri="
+ uri);
HttpResponse response = Request.Put(uri)
.bodyByteArray(Files.readAllBytes(Paths.get(pathName)))
.execute().returnResponse();
return readResponse(response);
}
and in this file MagicParameters.java
import java.nio.File;
import java.nio.file.Paths;
import java.nio.File;
import java.nio.file.Paths;
/**
* Helper for reading file as list of lines.
*
* @param path
* @param encoding
* @return content of file as string
* @throws IOException
* @since 0.0.1
*/
private List<String> readLines(String path, Charset encoding)
throws IOException {
List<String> lines = Files.readAllLines(Paths.get(path), encoding);
return lines;
}
sir can you please help me solve this error!
Metadata
Metadata
Assignees
Labels
No labels