本文整理汇总了Java中com.intellij.history.ByteContent.isDirectory方法的典型用法代码示例。如果您正苦于以下问题:Java ByteContent.isDirectory方法的具体用法?Java ByteContent.isDirectory怎么用?Java ByteContent.isDirectory使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.history.ByteContent
的用法示例。
在下文中一共展示了ByteContent.isDirectory方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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();
}
示例2: 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();
}
}
示例3: 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();
}