本文整理汇总了Java中com.intellij.history.ByteContent类的典型用法代码示例。如果您正苦于以下问题:Java ByteContent类的具体用法?Java ByteContent怎么用?Java ByteContent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ByteContent类属于com.intellij.history包,在下文中一共展示了ByteContent类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: putLabel
import com.intellij.history.ByteContent; //导入依赖的package包/类
private LabelImpl putLabel(@NotNull final PutLabelChange c) {
addChange(c);
return new LabelImpl() {
@Override
public ByteContent getByteContent(RootEntry root, String path) {
return getByteContentBefore(root, path, c);
}
};
}
示例2: getByteContentBefore
import com.intellij.history.ByteContent; //导入依赖的package包/类
private ByteContent getByteContentBefore(RootEntry root, String path, Change change) {
root = root.copy();
revertUpTo(root, "", null, change, false, false);
Entry entry = root.findEntry(path);
if (entry == null) return new ByteContent(false, null);
if (entry.isDirectory()) return new ByteContent(true, null);
return new ByteContent(false, entry.getContent().getBytesIfAvailable());
}
示例3: loadContent
import com.intellij.history.ByteContent; //导入依赖的package包/类
@NotNull
private static byte[] loadContent(@NotNull VirtualFilePointer filePointer, @NotNull Label label) throws DiffRequestProducerException {
String path = filePointer.getPresentableUrl();
ByteContent byteContent = label.getByteContent(FileUtil.toSystemIndependentName(path));
if (byteContent == null || byteContent.isDirectory() || byteContent.getBytes() == null) {
throw new DiffRequestProducerException("Can't load content");
}
return byteContent.getBytes();
}
示例4: convert
import com.intellij.history.ByteContent; //导入依赖的package包/类
@Nullable
public String convert(final VirtualFilePointer pointer) {
if (pointer == null) return null;
final String path = pointer.getPresentableUrl();
final ByteContent byteContent = myLabel.getByteContent(FileUtil.toSystemIndependentName(path));
if (byteContent == null || byteContent.isDirectory() || byteContent.getBytes() == null) {
return null;
}
final VirtualFile vf = pointer.getFile();
if (vf == null) {
return LoadTextUtil.getTextByBinaryPresentation(byteContent.getBytes(), EncodingManager.getInstance().getDefaultCharset()).toString();
} else {
return LoadTextUtil.getTextByBinaryPresentation(byteContent.getBytes(), vf).toString();
}
}
示例5: putLabel
import com.intellij.history.ByteContent; //导入依赖的package包/类
private LabelImpl putLabel(@Nonnull final PutLabelChange c) {
addChange(c);
return new LabelImpl() {
@Override
public long getLabelChangeId() {
return c.getId();
}
@Override
public ByteContent getByteContent(RootEntry root, String path) {
return getByteContentBefore(root, path, c);
}
};
}
示例6: getByteContentBefore
import com.intellij.history.ByteContent; //导入依赖的package包/类
private ByteContent getByteContentBefore(RootEntry root, String path, Change change) {
root = root.copy();
String newPath = revertUpTo(root, path, null, change, false, false);
Entry entry = root.findEntry(newPath);
if (entry == null) return new ByteContent(false, null);
if (entry.isDirectory()) return new ByteContent(true, null);
return new ByteContent(false, entry.getContent().getBytesIfAvailable());
}
示例7: loadContent
import com.intellij.history.ByteContent; //导入依赖的package包/类
@Nonnull
private static byte[] loadContent(@Nonnull FilePath filePointer, @Nonnull Label label) throws DiffRequestProducerException {
String path = filePointer.getPresentableUrl();
ByteContent byteContent = label.getByteContent(FileUtil.toSystemIndependentName(path));
if (byteContent == null || byteContent.isDirectory() || byteContent.getBytes() == null) {
throw new DiffRequestProducerException("Can't load content");
}
return byteContent.getBytes();
}
示例8: getByteContent
import com.intellij.history.ByteContent; //导入依赖的package包/类
ByteContent getByteContent(RootEntry root, String path);