Commit Graph

50 Commits

Author SHA1 Message Date
Ilya Gorbunov d46501e11b Make all remaining deprecations to be errors. 2016-01-27 18:34:32 +03:00
Ilya Gorbunov 4296b7f882 Breaking: make copyTo return target file instead of its size. 2016-01-27 00:29:09 +03:00
Ilya Gorbunov 45c9cc4add Breaking: Change File.copyTo contract to be similar to Files.copy from JDK8. 2016-01-26 11:49:02 +03:00
Ilya Gorbunov 67663c43ae Introduce overwrite parameter to File.copyRecursively.
#KT-8924 Fixed
2016-01-26 02:26:33 +03:00
Ilya Gorbunov 8bf638c60f Drop deprecations: FileTreeWalk deprecated API elements. 2016-01-22 05:54:38 +03:00
Ilya Gorbunov e9c14a02d3 Make FilePathComponents internal, temporary disable tests of internal API 2016-01-22 05:54:38 +03:00
Ilya Gorbunov c1ad82ff8c Harden charset-as-string taking function deprecations.
Fix usages in compiler.
2016-01-22 05:54:38 +03:00
Ilya Gorbunov b39b29dfea Drop deprecations: io and threading functions. 2016-01-22 05:54:38 +03:00
Ilya Gorbunov 57dcbe0aea Cleanup in libraries and tools: use property access syntax. 2016-01-17 15:52:14 +03:00
Ilya Gorbunov 19a4f65fd1 Cleanup in libraries 2016-01-17 15:52:12 +03:00
Ilya Gorbunov d64882e19b File.useLines and Reader.readLines. 2016-01-14 18:30:45 +03:00
Ilya Gorbunov ea3a2eefe7 File.deleteRecursively returns true even if path specified by File does not exist.
False is returned only in case of incomplete deletion.
Distinguish situations when file was not deleted because it's vanished after listing and because of some other error.
2016-01-14 18:14:12 +03:00
Ilya Gorbunov 5e6489f1a2 Minor: refactor file utils test not to use 'assert' to make test assertions. Use assertTrue, assertFalse, assertEquals, assertFailsWith instead. 2016-01-14 18:14:11 +03:00
Stanislav Erokhin 1574dc78df Synthetic extensions wins against top-level extension. 2015-12-18 22:49:25 +03:00
Ilya Gorbunov a4f82a2dc4 Sensible behavior for File.startsWith and File.endsWith 2015-12-14 06:10:26 +03:00
Ilya Gorbunov d2e22dc794 Fix tests on linux.
Add tests for File.startsWith
2015-12-14 06:10:24 +03:00
Ilya Gorbunov 645c78e2f4 Do not use assert in test, use assertTrue or assertEquals 2015-12-14 06:10:22 +03:00
Ilya Gorbunov cb71e05c51 Deprecate File.directory, root, rootName as properties with unclear behavior. 2015-12-14 06:10:21 +03:00
Ilya Gorbunov 7c9b53c75c Do not convert separatorsToSystem in file path extensions.
Do not require network host in network share root to contain dot.
File.root now is always non-null to be consistent with File.toComponents().root.
Introduce invariantSeparatorsPath property.
Deprecate relativeTo to make it return File later. Introduce toRelativeString instead.
Introduce relativeToOrNull and relativeToOrSelf extensions.
2015-12-14 06:10:18 +03:00
Ilya Gorbunov 52eb9e4276 Refactor FilePathComponents: rename properties, deprecate constructor, rename filePathComponents extension. 2015-12-14 06:09:55 +03:00
Ilya Gorbunov 8deefd56db Rename FileTreeWalk public parameters and builder methods.
Directory filtering now is performed in newly introduced onEnter predicate.
2015-12-14 05:16:06 +03:00
Ilya Gorbunov e24dbcefb6 Move all mutable state from FileTreeWalk to its iterator implementation, allowing this sequence to be iterated several times.
Introduce SingleFileState for single file walks.
Do not check isDirectory in DirectoryState constructor unless assertions are enabled.
2015-12-14 05:16:04 +03:00
Ilya Gorbunov 061803d7b1 Compare root of FilePathComponents according to case-sensitivity rules of current file system. 2015-12-14 05:16:02 +03:00
Ilya Gorbunov 4f2887df64 FileTreeWalk tests: do not remove failed directory from stack as leave is also called on failed dirs. 2015-12-14 05:16:01 +03:00
Ilya Gorbunov 162b152133 Improve File.relativeTo handling relative paths. Paths are normalized before calculating relative path. "x".relativeTo("../y") now is considered to have incompatible roots. 2015-12-14 05:15:59 +03:00
Ilya Gorbunov 9f5a972816 Improve resolve and resolveSibling for relative paths. 2015-12-14 05:15:57 +03:00
Ilya Gorbunov 923effe11d Change FilePathComponents parsing for file with empty name to enhance finding relative path between relative paths. 2015-12-14 05:15:55 +03:00
Ilya Gorbunov 6301c707cd Ensure resolveTo fails as expected.
Change UNC paths not to be misinterpreted on *nix.
2015-12-14 05:15:53 +03:00
Ilya Gorbunov 515d2cd3e7 FileTreeWalk.filter was dropped, use treeFilter otherwise filtering result becomes different.
Refactor walking tests.
2015-12-14 05:15:50 +03:00
Ilya Gorbunov 27551a8399 Make some io test classes non-nested as it's not supported by runners. 2015-12-14 05:15:48 +03:00
Alexander Udalov db2521ee67 Rework TestlibTest, use JUnit console runner instead of manual suite
The problem with the manually created suite was that it was created in setUp()
and so a lot of the hard work (compilation, test case lookup) was happening in
setUp(). If any exception is thrown in setUp(), tearDown() is not called,
leaving the application (~9000+ subsequent tests) in the inconsistent state.

Support JUnit 4 tests via JUnit4TestAdapter. Previously only a small number of
test classes were actually run because this test was looking only for JUnit 3
testcases.

Delete FilesTest#relativePath because it was testing a deprecated function
and was failing if run from the project root
2015-11-30 18:58:00 +03:00
Ilya Gorbunov 88e48380af StdLib cleanup, deprecated symbol usage: Throwable.getMessage 2015-11-21 00:54:09 +03:00
Ilya Gorbunov dadcdb5771 StdLib cleanup, deprecated symbol usage: List and Map members 2015-11-21 00:54:08 +03:00
Ilya Gorbunov 07654eb82b StdLib cleanup, deprecated symbol usage: size() and length() 2015-11-21 00:54:05 +03:00
Ilya Gorbunov be9b14545f Drop deprecations and tighten up left ones. 2015-11-11 18:59:53 +03:00
Ilya Gorbunov 73e41fb216 StdLib cleanup: remove unused imports 2015-10-07 22:36:13 +03:00
Denis Zharkov 5cecaa6f87 Get rid of deprecated annotations and modifiers in stdlib (besides JS) 2015-09-18 10:14:28 +03:00
Ilya Gorbunov 470fcc977c Drop test DSL experiments. 2015-09-08 10:27:08 +03:00
Ilya Gorbunov 00a44f6d4f StdLib deprecations cleanup: *array -> *arrayOf, copyToArray -> toTypedArray. 2015-06-29 17:05:57 +03:00
Ilya Gorbunov 13c89b7ae9 Provide lineSequence() extension method instead of BufferedReader.lines() in order not to conflict with JDK8 instance method with the same name. 2015-06-04 16:32:17 +03:00
Ilya Gorbunov 0302dd06f7 Do not call mkdirs when destination file of copyTo doesn't have any parent directory.
#KT-7888 Fixed
2015-06-02 15:50:47 +03:00
Mikhail Glukhikh ef6698bd52 Test fixed 2015-03-30 10:55:24 +03:00
Mikhail Glukhikh 5d7e388276 Fix of KT-7130 2015-03-30 10:55:21 +03:00
Mikhail Glukhikh 2bc124fa3d IO second review: empty File.subPath() allowed, OutputStream.bufferedWriter() added,
normalize(), startsWith(), endsWith() rewritten, LinesStream --> LinesSequence,
File.replaceBytes() / replaceText() rolled back to writeBytes() / writeText(),
some exception messages formulated more clearly, refactorings, comments,
relativeTo() slightly optimized, additional tests
2015-03-24 19:52:19 +03:00
Mikhail Glukhikh 88733d34eb Additional fix of String.getRootName() for network names, relevant test fixes 2015-03-24 19:40:24 +03:00
Mikhail Glukhikh 5b636eef7b Kotlin I/O review/M11 fixes: Stream --> Sequence, recurse() returned back,
additional helpers like File.bufferedReader() and String.byteInputStream(),
copyRecursively / deleteRecursively were rewritten using FileTreeWalk,
FilePathComponents introduced as a replacement of FileIterator,
classes / methods / properties permissions fixed, Linux specific things,
resolveSibling rewritten using FilePathComponents
2015-03-24 19:40:21 +03:00
Denis Mekhanikov f560677b15 Kotlin I/O new features: relativeTo, copyTo, copyRecursively, deleteRecursively, file tree walkers,
file component iterators, file roots, startsWith, endsWith, subPath, normalize, replaceBytes, replaceTest,
additional tests and comments
2015-03-24 19:40:19 +03:00
Ilya Ryzhenkov fa0542b801 Clean size/length/first/head/empty properties and functions. 2014-12-16 17:33:21 +03:00
Denis Mekhanikov 80493aa4e6 stdlib: improve tests 2014-11-07 17:14:57 +03:00
Ilya Ryzhenkov e37d8174c3 New stdlib generators 2014-03-19 20:25:11 +04:00