Commit Graph
178 Commits
Author SHA1 Message Date
Stephen Connolly 77abe1d11c tidy up @since tags after merge 2015-03-20 16:56:53 +00:00
Stephen Connolly 1cb69f8cc0 Move isRelativePath to Util and use from hudson.model.Slave's descriptor 2015-03-19 13:56:38 +00:00
Daniel Beck daacb02057 [JENKINS-16184] Also escape greater-than character 2014-10-09 00:38:22 +02:00
Oleg Nenashev 6c2fffb248 Fixed annotations in hudson/Util.java according to the discussion with @jglick and @kutzi
Signed-off-by: Oleg Nenashev <o.v.nenashev@gmail.com>
2014-05-05 22:26:12 +04:00
Oleg Nenashev 48cc7e03d4 Annotate hudson.Util methods.
The change adds annotations for all methods inside the class. The initial idea - enforce checks of symlink methods to prevent NPEs on Windows platforms.

Signed-off-by: Oleg Nenashev <o.v.nenashev@gmail.com>
2014-05-04 12:39:02 +04:00
Marco Miller d0f84c2e53 [FIXED JENKINS-20610] symlink FileAlreadyExistsException
Retrying 3 times while waiting for 100 millis between retries (at
recreating symlink after "deleting" it). Ends up throwing FAE exception
if thrown for a 4th time in a row - as not much can be done at that
point. A warning is logged in that case, prior to throwing the last FAE.
2013-11-15 16:32:27 -05:00
Jesse Glick c2366eeda5 Updated a couple of comments referring to Java 5. 2013-11-15 08:46:14 -05:00
Jesse Glick 4825967fe3 Deleting code using @IgnoreJRERequirement for Java 5 compatibility. 2013-11-15 08:43:40 -05:00
Jesse Glick 15ac490af1 Now that we use Java 6, can finally deprecate IOException2. 2013-11-15 08:19:59 -05:00
Larry North 3376cf0158 [FIXED JENKINS-16660] Allow variable names with dots in bracketed references.
Given these <variable,value> mappings: <A,a> and <A.B,a-b>, $A.B would
evaluate to $a.B, as it currently does, and ${A.B} to a-b instead of the
current ${A.B}.

Existing ${A.B}-like references will break (not evaluate to ${A.B}) if
there actually is an A.B variable defined, which I think is very
unlikely.
2013-07-26 21:15:51 -07:00
Jesse Glick 11953750ab [[JENKINS-16301] Use a buffered input stream to get somewhat better performance also from Maven archiving.
Introducing Util.getDigestOf(File) as a convenience.
2013-07-24 16:30:48 -04:00
Jesse Glick e0a3a1ddf5 [FIXED JENKINS-18178] Reverting an inessential part of the fix of JENKINS-16301 since it broke some Maven builds.
Apparently the Maven 2 process factory fails to adequately insulate the Maven process from Jenkins library dependencies;
if you specify a build extension that can override dependencies used by Jenkins core classes!
A real fix would involve changing class loader delegation, since presumably similar bugs could still occur.
2013-07-24 16:22:48 -04:00
Jesse Glick a0ff0b2f76 Typo in Javadoc. 2013-07-24 14:56:09 -04:00
Jesse Glick 7f966f6f31 [FIXED JENKINS-18351] Better fix for file handle leak. 2013-06-14 18:11:14 -04:00
Jesse Glick b1c82f1e30 stephenc asks to use TODO rather than XXX 2013-06-10 11:53:13 -04:00
Jesse Glick 2a1d1631bd [FIXED JENKINS-14351] jna-posix → jnr-posix upgrade (opt in). 2013-05-31 14:36:15 -04:00
Jesse Glick 51fbd2d867 [JENKINS-16301] Replace impl of getDigestOf with standard (Commons Codec) DigestUtils.md5Hex, for simplicity. 2013-05-21 17:41:39 -04:00
Jesse Glick 3c2b50ecfe [FIXED JENKINS-17681] Do not try to call resolveSymlink on a nonexistent link as you will just get an IOException, breaking peephole permalinks in some Windows environments. 2013-05-01 20:13:18 -04:00
Kohsuke Kawaguchi 368d8c7394 Don't let the error icon get clipped when the text is short.
On Chrome (and possibly others), an inline element like span doesn't enlarge
its size to cover its content, so the 1px place holder wasn't taking effect.

To ensure the minimum height of 16px, make it an inline-block element. I'm
not entirely sure how an inline-block element with no fixed width would behave,
but with a bit of casual testing, the text inside seems to wrap OK.
2013-04-19 10:11:28 -07:00
Kohsuke Kawaguchi b27bc585a8 merged back the RC branch 2013-04-06 18:58:00 -07:00
Kohsuke Kawaguchi dc94b7d063 [FIXED JENKINS-8686]
As I mentioned in the comment, I doubt if this makes any behaviour change, but this seems like a sensible defensive measure that wouldn't hurt.
2013-04-02 09:58:50 -07:00
Kohsuke Kawaguchi a016f3da07 [FIXED JENKINS-17343]
Don't break Windows XP, fall back gracefully to no-op.
2013-04-02 09:27:09 -07:00
Jesse Glick 21912fe3dd @code in Javadoc. 2013-03-28 14:53:54 -04:00
Jesse Glick 78b263421f [FIXED JENKINS-17271] Util.deleteFile should give a concrete reason for failure. 2013-03-19 11:05:21 -04:00
Jesse Glick 606a9e1de9 File.setWritable should be the first, and if possible only, thing we try for makeWritable. 2013-03-19 10:13:19 -04:00
Jesse Glick a32f2dd39d Removing obsolete comment. 2013-03-14 10:27:56 -04:00
Kohsuke Kawaguchi 28bf5d8002 [FIXED JENKINS-15587]
The actual fix was in the pull request #675.
2013-03-12 22:13:26 -07:00
Kohsuke Kawaguchi 2f781863f5 Massaging the fix.
- ID_FORMATTER is time zone sensitive, so comparing against # of
  milliseconds since the epoch won't be portable.

- resolveSymlink can return a relative path.
2013-03-12 22:11:26 -07:00
Kohsuke Kawaguchi 88feabb429 [FIXED JENKINS-16089]
Remember the permalink target as symlink (or simple text file) so that
looking that up doesn't cause the walk of the build history.
I think this is more in line with our general preference of making
$JENKINS_HOME useful (than trying to persist cache into a blackbox.)

Having a general purpose in-memory cache could be useful, so I'll see if
I can add that, too, in a way that allows someone to plug different
backend.
2013-03-12 14:21:38 -07:00
Kohsuke Kawaguchi d97b0834c8 Windows symbolic support for Java5/6 2013-03-12 14:19:49 -07:00
Jesse Glick 915d825327 Further clarification of targetPath. It is not necessarily relative to baseDir! 2013-03-08 19:59:46 -05:00
Jesse Glick 400fa878e6 Verifying that symlink target may be absolute. 2013-03-08 18:55:49 -05:00
Jesse Glick ad4c39f5e2 Clarifying that symlinkPath may not be absolute. 2013-03-08 18:38:56 -05:00
Kohsuke Kawaguchi 00bfa35651 Added a convenience method.
This change is originally from pull request #682.
2013-02-28 17:33:36 -08:00
Jesse Glick 010866ba90 [FIXED JENKINS-15466] More robust handling of Windows JNA errors.
b5ed319 already caught linkage errors but then unconditionally returned false from Util.isSymlink, which is wrong;
we want to fall back to the generic File.canonicalPath comparisons in this case.
2013-02-27 11:11:34 -05:00
Vojtech Juranek 9993468ce4 Merge branch 'revert-ampersand-encoding' of https://github.com/lvotypko/jenkins into pull683
Conflicts:
	core/src/test/java/hudson/UtilTest.java
2013-02-27 15:33:31 +01:00
lvotypko df00baea5a Revert changes in method encode too. 2013-02-11 11:35:15 +01:00
lvotypko f2de2aca92 Revert javadoc too. 2013-01-30 13:16:41 +01:00
lvotypko 3d568123f3 Revert changes which broke backwad compatibility based on discussion in jenkins-dev list 2013-01-29 15:51:16 +01:00
Kohsuke Kawaguchi d32f9e5113 merged back the RC branch 2012-11-18 17:59:10 -08:00
Kohsuke Kawaguchi 68e84726ab [FIXED SECURITY-45] 2012-11-17 12:02:49 -08:00
Jesse Glick 0552f5ad75 [JENKINS-13202] 646154f refinement: resolveSymlink is documented to return null, not throw an exception, when called on a regular file. 2012-11-16 13:41:22 -05:00
Jesse Glick ced5c44323 [FIXED JENKINS-15316] Harmless but noisy exception running builds on some Windows systems in non-English locale.
Falling back to just checking for ‘FileSystemException’ since detail message about missing required privilege may be translated.
2012-10-15 14:52:04 -04:00
Jesse Glick 66cf64d88d More graceful handling of Windows accounts with symlinks disabled. 2012-09-10 17:20:17 -04:00
Jesse Glick b6f924d111 Splitting some Java 7 code into its own methods for clarity.
(Not doing so for resolveSymlink since it would require an awkward four-way return value:
String, null (not a symlink), IOException, <something else> for Java 5/6.)
2012-09-10 12:07:43 -04:00
Jesse Glick 1fb7541975 @IgnoreJRERequirement not necessary when using reflection to access APIs. 2012-09-06 18:28:32 -04:00
Jesse Glick ed748d4b81 Try to use NIO.2 (Java 7) methods to work with symlinks, falling back to JNA (or worse) only on Java 5–6. 2012-09-06 14:31:27 -04:00
Andrew Stucki a9a019918b Fix Windows symlink detection 2012-07-24 13:09:01 -05:00
Olivier Lamy 5379a8100c Merge pull request #496 from lvotypko/url-without-ampersand
Fix UtilTest and replace ampersand in method encode too
Thanks !
2012-06-14 05:56:56 -07:00
lvotypko c667523d44 Fix UtilTest and replace ampersand in method encode too 2012-06-13 13:17:19 +02:00