diff --git a/classlib/src/main/java/org/teavm/classlib/java/io/TUncheckedIOException.java b/classlib/src/main/java/org/teavm/classlib/java/io/TUncheckedIOException.java index 3b32f02b3..bd9e4f2f4 100644 --- a/classlib/src/main/java/org/teavm/classlib/java/io/TUncheckedIOException.java +++ b/classlib/src/main/java/org/teavm/classlib/java/io/TUncheckedIOException.java @@ -1,3 +1,18 @@ +/* + * Copyright 2023 Jonathan Coates. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.teavm.classlib.java.io; import java.io.IOException; diff --git a/classlib/src/main/java/org/teavm/classlib/java/nio/channels/TByteChannel.java b/classlib/src/main/java/org/teavm/classlib/java/nio/channels/TByteChannel.java index c8f1231bd..4afe85cb2 100644 --- a/classlib/src/main/java/org/teavm/classlib/java/nio/channels/TByteChannel.java +++ b/classlib/src/main/java/org/teavm/classlib/java/nio/channels/TByteChannel.java @@ -1,3 +1,18 @@ +/* + * Copyright 2023 Jonathan Coates. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.teavm.classlib.java.nio.channels; public interface TByteChannel extends TReadableByteChannel, TWritableByteChannel { diff --git a/classlib/src/main/java/org/teavm/classlib/java/nio/channels/TChannel.java b/classlib/src/main/java/org/teavm/classlib/java/nio/channels/TChannel.java index 484b59bf5..a30e71ed3 100644 --- a/classlib/src/main/java/org/teavm/classlib/java/nio/channels/TChannel.java +++ b/classlib/src/main/java/org/teavm/classlib/java/nio/channels/TChannel.java @@ -1,8 +1,22 @@ +/* + * Copyright 2023 Jonathan Coates. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.teavm.classlib.java.nio.channels; -import org.teavm.classlib.java.io.TCloseable; - import java.io.IOException; +import org.teavm.classlib.java.io.TCloseable; public interface TChannel extends TCloseable { boolean isOpen(); diff --git a/classlib/src/main/java/org/teavm/classlib/java/nio/channels/TClosedChannelException.java b/classlib/src/main/java/org/teavm/classlib/java/nio/channels/TClosedChannelException.java index 891d00a0d..396ba088e 100644 --- a/classlib/src/main/java/org/teavm/classlib/java/nio/channels/TClosedChannelException.java +++ b/classlib/src/main/java/org/teavm/classlib/java/nio/channels/TClosedChannelException.java @@ -1,3 +1,18 @@ +/* + * Copyright 2023 Jonathan Coates. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.teavm.classlib.java.nio.channels; import java.io.IOException; diff --git a/classlib/src/main/java/org/teavm/classlib/java/nio/channels/TNonReadableChannelException.java b/classlib/src/main/java/org/teavm/classlib/java/nio/channels/TNonReadableChannelException.java index 46d821740..a4970d16a 100644 --- a/classlib/src/main/java/org/teavm/classlib/java/nio/channels/TNonReadableChannelException.java +++ b/classlib/src/main/java/org/teavm/classlib/java/nio/channels/TNonReadableChannelException.java @@ -1,3 +1,18 @@ +/* + * Copyright 2023 Jonathan Coates. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.teavm.classlib.java.nio.channels; public class TNonReadableChannelException extends IllegalStateException { diff --git a/classlib/src/main/java/org/teavm/classlib/java/nio/channels/TNonWritableChannelException.java b/classlib/src/main/java/org/teavm/classlib/java/nio/channels/TNonWritableChannelException.java index 62a5117fb..dc0fec646 100644 --- a/classlib/src/main/java/org/teavm/classlib/java/nio/channels/TNonWritableChannelException.java +++ b/classlib/src/main/java/org/teavm/classlib/java/nio/channels/TNonWritableChannelException.java @@ -1,3 +1,18 @@ +/* + * Copyright 2023 Jonathan Coates. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.teavm.classlib.java.nio.channels; public class TNonWritableChannelException extends IllegalStateException { diff --git a/classlib/src/main/java/org/teavm/classlib/java/nio/channels/TReadableByteChannel.java b/classlib/src/main/java/org/teavm/classlib/java/nio/channels/TReadableByteChannel.java index 5e697f7f4..95c086cc0 100644 --- a/classlib/src/main/java/org/teavm/classlib/java/nio/channels/TReadableByteChannel.java +++ b/classlib/src/main/java/org/teavm/classlib/java/nio/channels/TReadableByteChannel.java @@ -1,8 +1,22 @@ +/* + * Copyright 2023 Jonathan Coates. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.teavm.classlib.java.nio.channels; -import org.teavm.classlib.java.nio.TByteBuffer; - import java.io.IOException; +import org.teavm.classlib.java.nio.TByteBuffer; public interface TReadableByteChannel extends TChannel { int read(TByteBuffer dst) throws IOException; diff --git a/classlib/src/main/java/org/teavm/classlib/java/nio/channels/TSeekableByteChannel.java b/classlib/src/main/java/org/teavm/classlib/java/nio/channels/TSeekableByteChannel.java index dfaa88898..20ef9cfad 100644 --- a/classlib/src/main/java/org/teavm/classlib/java/nio/channels/TSeekableByteChannel.java +++ b/classlib/src/main/java/org/teavm/classlib/java/nio/channels/TSeekableByteChannel.java @@ -1,3 +1,18 @@ +/* + * Copyright 2023 Jonathan Coates. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.teavm.classlib.java.nio.channels; import java.io.IOException; diff --git a/classlib/src/main/java/org/teavm/classlib/java/nio/channels/TWritableByteChannel.java b/classlib/src/main/java/org/teavm/classlib/java/nio/channels/TWritableByteChannel.java index 4b601f437..72628894f 100644 --- a/classlib/src/main/java/org/teavm/classlib/java/nio/channels/TWritableByteChannel.java +++ b/classlib/src/main/java/org/teavm/classlib/java/nio/channels/TWritableByteChannel.java @@ -1,8 +1,22 @@ +/* + * Copyright 2023 Jonathan Coates. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.teavm.classlib.java.nio.channels; -import org.teavm.classlib.java.nio.TByteBuffer; - import java.io.IOException; +import org.teavm.classlib.java.nio.TByteBuffer; public interface TWritableByteChannel extends TChannel { int write(TByteBuffer src) throws IOException; diff --git a/classlib/src/main/java/org/teavm/classlib/java/nio/file/TAccessDeniedException.java b/classlib/src/main/java/org/teavm/classlib/java/nio/file/TAccessDeniedException.java index 0d7aef002..e286519c2 100644 --- a/classlib/src/main/java/org/teavm/classlib/java/nio/file/TAccessDeniedException.java +++ b/classlib/src/main/java/org/teavm/classlib/java/nio/file/TAccessDeniedException.java @@ -1,3 +1,18 @@ +/* + * Copyright 2023 Jonathan Coates. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.teavm.classlib.java.nio.file; public class TAccessDeniedException extends TFileSystemException { diff --git a/classlib/src/main/java/org/teavm/classlib/java/nio/file/TFileSystemException.java b/classlib/src/main/java/org/teavm/classlib/java/nio/file/TFileSystemException.java index 61876a652..15b7c788c 100644 --- a/classlib/src/main/java/org/teavm/classlib/java/nio/file/TFileSystemException.java +++ b/classlib/src/main/java/org/teavm/classlib/java/nio/file/TFileSystemException.java @@ -1,3 +1,18 @@ +/* + * Copyright 2023 Jonathan Coates. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.teavm.classlib.java.nio.file; import java.io.IOException; @@ -36,12 +51,20 @@ public class TFileSystemException extends IOException { @Override public String getMessage() { - if (file == null && other == null) return reason; + if (file == null && other == null) { + return reason; + } StringBuilder out = new StringBuilder(); - if (file != null) out.append(file); - if (other != null) out.append(" -> ").append(other); - if (reason != null) out.append(": ").append(reason); + if (file != null) { + out.append(file); + } + if (other != null) { + out.append(" -> ").append(other); + } + if (reason != null) { + out.append(": ").append(reason); + } return out.toString(); } }