本文整理匯總了Java中org.keyczar.i18n.Messages.getString方法的典型用法代碼示例。如果您正苦於以下問題:Java Messages.getString方法的具體用法?Java Messages.getString怎麽用?Java Messages.getString使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.keyczar.i18n.Messages
的用法示例。
在下文中一共展示了Messages.getString方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: readFile
import org.keyczar.i18n.Messages; //導入方法依賴的package包/類
private static String readFile(String paramString)
throws KeyczarException
{
try
{
RandomAccessFile localRandomAccessFile = new RandomAccessFile(paramString, "r");
byte[] arrayOfByte = new byte[(int)localRandomAccessFile.length()];
localRandomAccessFile.read(arrayOfByte);
localRandomAccessFile.close();
String str = new String(arrayOfByte);
return str;
}
catch (IOException localIOException)
{
throw new KeyczarException(Messages.getString("KeyczarFileReader.FileError", new Object[] { paramString }), localIOException);
}
}
示例2: Keyczar
import org.keyczar.i18n.Messages; //導入方法依賴的package包/類
public Keyczar(KeyczarReader paramKeyczarReader)
throws KeyczarException
{
this.kmd = KeyMetadata.read(paramKeyczarReader.getMetadata());
if (!isAcceptablePurpose(this.kmd.purpose))
{
Object[] arrayOfObject = new Object[1];
arrayOfObject[0] = this.kmd.purpose;
throw new KeyczarException(Messages.getString("Keyczar.UnacceptablePurpose", arrayOfObject));
}
if ((this.kmd.encrypted) && (!(paramKeyczarReader instanceof EncryptedReader))) {
throw new KeyczarException(Messages.getString("Keyczar.NeedEncryptedReader", new Object[0]));
}
Iterator localIterator = this.kmd.versions.iterator();
while (localIterator.hasNext())
{
KeyVersion localKeyVersion = (KeyVersion)localIterator.next();
if (localKeyVersion.status == KeyStatus.PRIMARY)
{
if (this.primaryVersion != null) {
throw new KeyczarException(Messages.getString("Keyczar.SinglePrimary", new Object[0]));
}
this.primaryVersion = localKeyVersion;
}
KeyType localKeyType = this.kmd.type;
String str = paramKeyczarReader.getKey(localKeyVersion.versionNumber);
KeyczarKey localKeyczarKey = localKeyType.getBuilder().read(str);
LOG.debug(Messages.getString("Keyczar.ReadVersion", new Object[] { localKeyVersion }));
this.hashMap.put(new KeyHash(localKeyczarKey.hash(), (byte)0), localKeyczarKey);
this.versionMap.put(localKeyVersion, localKeyczarKey);
}
}
示例3: UnsupportedTypeException
import org.keyczar.i18n.Messages; //導入方法依賴的package包/類
public UnsupportedTypeException(KeyType paramKeyType)
{
super(Messages.getString("InvalidTypeInInput", new Object[] { paramKeyType }));
}
示例4: BadVersionException
import org.keyczar.i18n.Messages; //導入方法依賴的package包/類
public BadVersionException(byte paramByte)
{
super(Messages.getString("BadVersionNumber", arrayOfObject));
}
示例5: NoPrimaryKeyException
import org.keyczar.i18n.Messages; //導入方法依賴的package包/類
public NoPrimaryKeyException()
{
super(Messages.getString("NoPrimaryKeyFound", new Object[0]));
}
示例6: ShortSignatureException
import org.keyczar.i18n.Messages; //導入方法依賴的package包/類
public ShortSignatureException(int paramInt)
{
super(Messages.getString("SignatureTooShort", arrayOfObject));
}
示例7: KeyNotFoundException
import org.keyczar.i18n.Messages; //導入方法依賴的package包/類
public KeyNotFoundException(byte[] paramArrayOfByte)
{
super(Messages.getString("KeyWithHashIdentifier", arrayOfObject));
}