use of com.squareup.wire.java.internal.ProfileParser in project wire by square.
the class ProfileLoader method loadProfileFile.
/**
* Parses the {@code .wire} file at {@code base/path} and returns it. Returns null if no such
* file exists.
*/
private ProfileFileElement loadProfileFile(Path base, String path) throws IOException {
Source source = source(base, path);
if (source == null)
return null;
try {
Location location = Location.get(base.toString(), path);
String data = Okio.buffer(source).readUtf8();
return new ProfileParser(location, data).read();
} catch (IOException e) {
throw new IOException("Failed to load " + source + " from " + base, e);
} finally {
source.close();
}
}
Aggregations