Skip to content

Instantly share code, notes, and snippets.

@mgajdos
mgajdos / update-jersey-in-gf.sh
Last active June 17, 2017 01:20
Update Jersey in GlassFish 4.0.1
#!/bin/bash
JERSEY_VERSION=2.5.1
HK2_VERSION=2.2.0-b26
JAVASSIST_VERSION=3.18.1-GA
MODULES_DIR=`pwd`/modules
OSGI_CACHE_DIR=`pwd`/domains/domain1/osgi-cache/felix
processArtifact() {
@mgajdos
mgajdos / restore-jersey-in-gf.sh
Created January 20, 2014 18:05
Restore old Jersey in GlassFish 4.0.1
#!/bin/bash
MODULES_DIR=`pwd`/modules
OSGI_CACHE_DIR=`pwd`/domains/domain1/osgi-cache/felix
processArtifact() {
# Restore artifact
if [ -f ${MODULES_DIR}/$1.bak ]; then
echo "Restoring $1 ..."
mv ${MODULES_DIR}/$1.bak ${MODULES_DIR}/$1
@mgajdos
mgajdos / InvalidRequestUriITCase
Created February 3, 2015 10:07
Test-case for Jersey 2.x PR #114
/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2015 Oracle and/or its affiliates. All rights reserved.
*
* The contents of this file are subject to the terms of either the GNU
* General Public License Version 2 only ("GPL") or the Common Development
* and Distribution License("CDDL") (collectively, the "License"). You
* may not use this file except in compliance with the License. You can
* obtain a copy of the License at
@mgajdos
mgajdos / patch#1
Last active August 29, 2015 14:15
PR #143 Patch
diff --git a/media/multipart/src/main/java/org/glassfish/jersey/media/multipart/internal/MultiPartReaderClientSide.java b/media/multipart/src/main/java/org/glassfish/jersey/media/multipart/internal/MultiPartReaderClientSide.java
index 49fa175..e91d4d0 100644
--- a/media/multipart/src/main/java/org/glassfish/jersey/media/multipart/internal/MultiPartReaderClientSide.java
+++ b/media/multipart/src/main/java/org/glassfish/jersey/media/multipart/internal/MultiPartReaderClientSide.java
@@ -137,6 +137,7 @@ public class MultiPartReaderClientSide implements MessageBodyReader<MultiPart> {
if (properties.getBufferThreshold() != MultiPartProperties.BUFFER_THRESHOLD_MEMORY_ONLY) {
// Validate - this checks whether it's possible to create temp files in currently set temp directory.
try {
+ //noinspection ResultOfMethodCallIgnored
File.createTempFile("MIME", null, tempDir != null ? new File(tempDir) : null).delete();