|
|
|
|
|
|
|
|
|
|
|
|
|
|
package com.vaadin.server.communication; |
|
|
package com.vaadin.server.communication; |
|
|
|
|
|
|
|
|
import static java.nio.charset.StandardCharsets.UTF_8; |
|
|
|
|
|
|
|
|
|
|
|
import java.io.BufferedWriter; |
|
|
import java.io.BufferedWriter; |
|
|
import java.io.ByteArrayOutputStream; |
|
|
import java.io.ByteArrayOutputStream; |
|
|
import java.io.IOException; |
|
|
import java.io.IOException; |
|
|
|
|
|
|
|
|
import com.vaadin.ui.UI; |
|
|
import com.vaadin.ui.UI; |
|
|
import com.vaadin.ui.Upload.FailedEvent; |
|
|
import com.vaadin.ui.Upload.FailedEvent; |
|
|
|
|
|
|
|
|
|
|
|
import static java.nio.charset.StandardCharsets.UTF_8; |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* Handles a file upload request submitted via an Upload component. |
|
|
* Handles a file upload request submitted via an Upload component. |
|
|
* |
|
|
* |
|
|
|
|
|
|
|
|
} finally { |
|
|
} finally { |
|
|
session.unlock(); |
|
|
session.unlock(); |
|
|
} |
|
|
} |
|
|
return true; |
|
|
|
|
|
|
|
|
boolean pushEnabled = UI.getCurrent().getPushConfiguration() |
|
|
|
|
|
.getPushMode().isEnabled(); |
|
|
|
|
|
if (!pushEnabled) { |
|
|
|
|
|
return true; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// Note, we are not throwing interrupted exception forward as it is |
|
|
// Note, we are not throwing interrupted exception forward as it is |
|
|
// not a terminal level error like all other exception. |
|
|
// not a terminal level error like all other exception. |
|
|
} catch (final Exception e) { |
|
|
} catch (final Exception e) { |