* @return The result of the fetch, or {@code null} if an error occured
*/
public Fetched fetchUri(FreenetURI uri) {
- FetchResult fetchResult = null;
FreenetURI currentUri = new FreenetURI(uri);
while (true) {
try {
- fetchResult = client.fetch(currentUri);
+ FetchResult fetchResult = client.fetch(currentUri);
return new Fetched(currentUri, fetchResult);
} catch (FetchException fe1) {
if (fe1.getMode() == FetchException.PERMANENT_REDIRECT) {
Map<OwnIdentity, Map<String, Identity>> currentIdentities = new HashMap<OwnIdentity, Map<String, Identity>>();
Map<String, OwnIdentity> currentOwnIdentities = new HashMap<String, OwnIdentity>();
- Set<OwnIdentity> ownIdentities = null;
boolean identitiesLoaded = false;
try {
/* get all identities with the wanted context from WoT. */
logger.finer("Getting all Own Identities from WoT...");
- ownIdentities = webOfTrustConnector.loadAllOwnIdentities();
+ Set<OwnIdentity> ownIdentities = webOfTrustConnector.loadAllOwnIdentities();
logger.finest(String.format("Loaded %d Own Identities.", ownIdentities.size()));
/* load trusted identities. */
Bucket fileBucket = uploadedFile.getData();
InputStream imageInputStream = null;
ByteArrayOutputStream imageDataOutputStream = null;
- net.pterodactylus.sone.data.Image image = null;
try {
imageInputStream = fileBucket.getInputStream();
/* TODO - check length */
}
String mimeType = getMimeType(imageData);
TemporaryImage temporaryImage = webInterface.getCore().createTemporaryImage(mimeType, imageData);
- image = webInterface.getCore().createImage(currentSone, parent, temporaryImage);
+ net.pterodactylus.sone.data.Image image = webInterface.getCore().createImage(currentSone, parent, temporaryImage);
image.modify().setTitle(name).setDescription(TextFilter.filter(request.getHttpRequest().getHeader("host"), description)).setWidth(uploadedImage.getWidth(null)).setHeight(uploadedImage.getHeight(null)).update();
} catch (IOException ioe1) {
logger.log(Level.WARNING, "Could not read uploaded image!", ioe1);