我正在尝试运行代码
import com.google.api.services.drive.Drive;
import com.google.api.services.drive.model.ParentList;
import com.google.api.services.drive.model.ParentReference;
import java.io.IOException;
// ...
public class MyClass {
// ...
/**
* Print a file's parents.
*
* @param service Drive API service instance.
* @param fileId ID of the file to print parents for.
*/
private static void printParents(Drive service, String fileId) {
try {
ParentList parents = service.parents().list(fileId).execute();
for (ParentReference parent : parents.getItems()) {
System.out.println("File Id: " + parent.getId());
}
} catch (IOException e) {
System.out.println("An error occurred: " + e);
}
}
// ...
}
用于了解父母的详细信息。
添加的依赖项是
dependencies {
testCompile group: 'junit', name: 'junit', version: '4.11'
compile 'com.google.api-client:google-api-client:1.22.0'
compile 'com.google.oauth-client:google-oauth-client-jetty:1.22.0'
compile 'com.google.apis:google-api-services-drive:v3-rev59-1.22.0'
}
代码示例来自from this page
import com.google.api.services.drive.model.ParentList;
import com.google.api.services.drive.model.ParentReference;
以上导入实际上没有得到解决。请帮帮我。