import static org.opendaylight.yangtools.util.concurrent.FluentFutures.immediateFailedFluentFuture;
import static org.opendaylight.yangtools.util.concurrent.FluentFutures.immediateFluentFuture;
-import com.google.common.base.MoreObjects.ToStringHelper;
import com.google.common.util.concurrent.FluentFuture;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.io.File;
@Override
public YangTextSchemaSource restoreAsType(final SourceIdentifier sourceIdentifier, final File cachedSource) {
- return new YangTextSchemaSource(sourceIdentifier) {
-
- @Override
- protected ToStringHelper addToStringAttributes(final ToStringHelper toStringHelper) {
- return toStringHelper;
- }
-
- @Override
- public InputStream openStream() throws IOException {
- return Files.newInputStream(cachedSource.toPath());
- }
- };
+ return YangTextSchemaSource.forFile(cachedSource, sourceIdentifier);
}
}