* [JENKINS-48407] Re-enable test
The previous test assumed permissions would always be the same,
when they actually depend on umask settings.
This change creates a file *not* using the temporary API, gets its
permissions then compares it to the ones obtained using
AtomicFileWriter.
Note: we now only check the given permissions, not the "non-given".
* Use assertThat(..., equalTo()) instead of a manual loop
* Remove unused imports
* Use TemporaryFolder instead of manual temporary dir creation
file handle cleanup in the event of failure
Fixed small nits regarding typo's and code cleanup
Added comment explaining why Xpp3 is still included as a dep
KXml2Driver being tolerant of control characters which should be illegal
in an XML v1.0 content. This test should be revisted if we switch to
another XML driver
technically illegal xml (ie. it doesn't complain if an Xml v1.0 file
contains special characters). Added a unit test that proves this, as well
as fixing silentlyMigrateConfigsTest so that it starts with technically
valid Xml 1.0 content
- verify can still read xml 1.0
- verify can read xml 1.1
- verify can read xml 1.1 with 'special' characters
- verify that jenkins can start with a config.xml having
<?xml version='1.1'> and special characters
Changed all explicit references of the hierarchical driver to use a static
convinience method XStream2.getDefaultDriver() to ensure all XML operations
are using the same driver.
- switched to KxmlDriver (needed for xml 1.1 support)
- updated to create xml v1.1 headers
- updated test to use KXml2Driver explicitly
- updated unit tests to support xml v1.1
* [JENKINS-48447] Fixed HTTP 404 error when clicking on newView sidebar link from an other view.
* [JENKINS-48447] Fixed unit tests for NewViewLink
* [JENKINS-48447] Load url name each time object gets initialized and adapted tests.
* [JENKINS-48447] Rewrite tests for url name; fixed indenting.
* [JENKINS-48447] Fixed more identing.
* [JENKINS-48447] Added @Restricted to NewViewLink; undo URL_NAME renaming.
The goal here is to:
* be able to selectively choose performance over integrity in some very
specific cases
* be able to globally disable AtomicFileWriter integrity, and basically
revert to previous behaviour by setting a system property.
This flag is meant as an emergency one in case something goes very
wron on some production system.
* Use "Files.createTempDirectory" to create temp directory instead
See SonarQube critical vulnerability squid:S2976 (tag: owasp-a9)
https://next.sonarqube.com/sonarqube/coding_rules#rule_key=squid%3AS2976
* [JENKINS-48227]
Creating a utility "static Path toPath(File file) throws IOException" method,
which wraps InvalidPathException to IOException so that it will be checked.
- also fixed public static final reference
- fixed broken test cases
- added new test cases for toPath() and createTempDir()
* Revert back to public static int
* adjustments due to merges
* Add posix check to determine if Posix FileAttributes should be included
in call to Files.createTempDirectory()
* Remove reference to private element
* Updated to use explicit imports
* Use NIO in tryOnceDeleteFile and makeWritable
* Don't try to set PosixFileAttributes on Windows
* Do not create arbitrary exceptions in makeWritable to fix test failures on Windows
* Remove unhelpful layer of exception wrapping
* Add test exercising Util#makeWritable in Util#tryOnceDeleteFile
* Add test for deleting a non-existant file
* Return early if changing permissions with NIO succeeds
* Use NIO for FilePath#chmod and IOUtils#mode
* Add tests for NIO mode and chmod implementations
* Add test, remove new method, and update JavaDoc
* Provide system property to use native implementations of chmod and mode
* Revert unrelated whitespace modification
* Don't remove exception from throws and put imports in original location
* Fix broken JavaDoc links
* Ignore file type bits (above 0o7777) in Util#modeToPermission
* Use octal for constants and don't include file type bits
* Revert unnecessary changes to TarArchiverTest
* Add assertion that non-permission bits are ignored by chmod
* Use NIO copy with StandardCopyOption.COPY_ATTRIBUTES in copyToWithPermissions where possible
* Catch InvalidPathException and convert it to IOException
* Create utility method for File#toPath and use File#createDirectories after review
* Remove useless calls to toAbsolutePath and getAbsoluteFile
* Fix typos and use octal for constant after review
* Add test for behavior of copyToWithPermission with special bits