如何从Path生成Guava ByteSource?

时间:2017-05-20 13:57:46

标签: java file-io guava

我正在尝试使用Guava在Path处散列文件。我无法使用File类,因为JimFS不支持此类。

如果我有File,我会使用这种番石榴方法:

public static ByteSource asByteSource(File file)

是否有Path的等价物?

如果没有,我该如何实施呢?

1 个答案:

答案 0 :(得分:7)

如果您只能使用Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean) Dim strSubject As String strSubject = Item.Subject If Len(Trim(strSubject)) = 0 Then Prompt$ = "Subject is Empty. Are you sure you want to send the Mail?" If MsgBox(Prompt$, vbYesNo + vbQuestion + vbMsgBoxSetForeground, "Check for Subject") = vbNo Then Cancel = True End If End If End Sub ,请查看MoreFiles::asByteSource